How does one go about taking this script: --In a server script with fe it works
local getlights = game.Workspace.Lights:GetChildren() game:GetService("RunService").RenderStepped:connect(function() for i = 1, #getlights do if getlights[i].PointLight.Enabled == true then getlights[i].PointLight.Enabled = false print("all off") else getlights[i].PointLight.Enabled = true print("all on") end end end)
and put it in a local script with fe, So it works in play mode.
Don't see any problem here. However i would recommend using something that looks a bit cleaner, for example:
local getlights = workspace.Lights:GetChildren() game:GetService("RunService").RenderStepped:connect(function() for i,v in pairs (getlights) do v.PointLight.Enabled = not v.PointLight.Enabled end end)