RichardiOS275

FE2 Lighting Changer

Oct 17th, 2021
905
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local TweenService = game:GetService("TweenService")
  2. local Player = game:GetService("Players").LocalPlayer
  3. local map = workspace.Multiplayer:WaitForChild("Map")
  4.  
  5. for i, d in ipairs(map:GetDescendants()) do
  6.     if d.Name == "_Lighting" then
  7.         d.Parent.Touched:Connect(function(h)
  8.             if d:GetAttribute("debounce") == false and h.Parent == Player.Character then
  9.                 d:SetAttribute("debounce", true)
  10.                 local props = {}
  11.                 for _, p in ipairs(d:GetChildren()) do
  12.                     props[p.Name] = p.Value
  13.                 end
  14.                 TweenService:Create(game.Lighting,
  15.                     TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
  16.                     props
  17.                 ):Play()
  18.             end
  19.         end)
  20.     end
  21. end
RAW Paste Data