I have already used remote events to turn off the lights with the first click, but how do I turn them back on with a second click?
Here is the local script I put in StarterCharacterScripts ~~~~~~~~~~~~~~~~~
local trigger = game.Workspace.Trigger local clickDetector = trigger.ClickDetector local rep = game.ReplicatedStorage clickDetector.MouseClick:Connect(function() rep.LightsOff:FireServer()
end)
Here is the script that is receiving the event ~~~~~~~~~~~~~~~~~ local rep = game.ReplicatedStorage rep.LightsOff.OnServerEvent:Connect(function() script.Parent.PointLight.Enabled = false end)
This should work! If it doesn't let me know! (I know there are more efficient ways but this is simple and should work)
local rep = game.ReplicatedStorage rep.LightsOff.OnServerEvent:Connect(function() if script.Parent.PointLight.Enabled == false then script.Parent.PointLight.Enabled = true else script.Parent.PointLight.Enabled = false end end)