All right, so I before I explain my issues I'd like to say I've only been learning Roblox lua for the good part of two days. I have surfed the entirety of the internet trying to find a solution to this and rewritten the code at least a hundred times, and I have yet to figure out how to rig a simple on and off switch for a light. At first, I noticed light could only be turned off and was not able to be turned back on. I then tried to put it into a while loop, which showed in the output that it was turning the light on very quickly and then off again. In conclusion, I am unsure of how to organize the code so that the script reads the code in a way that it will understand that when the light is Off, it will turn it On. I'm not asking for anyone to write the script for me, all I need is a shove in the right direction. Thanks!
local Light = script.Parent.PointLight
local Click = Instance.new("ClickDetector")
Click.Parent = script.Parent
Click.MaxActivationDistance = 10
if Light.Enabled == false then Click.MouseClick:Connect(function()
Light.Enabled = true
print("Light turned on")
end)
elseif Light.Enabled == true then Click.MouseClick:Connect(function()
Light.Enabled == false
print("Light turned off")
end)
end

5 comments
Damit, I am typing on a digital device, you wrote faster:(
B)
You have enough rep, can you leave some?;)
i just want a hEcKiNg uPvOtE. i need 20 for next rank
woah, buddy, slow down here, you've helped me though so I'll do you a solid, but I expect a solid in return?