function bedlight()
local state = script.Parent.Parent.Parent.State
local switch = script.Parent.Parent.Parent
local lamp = script.Parent.PointLight
if state.Value == false then
state.Value = true
lamp.Enabled = true
else
state.Value = false
lamp.Enabled = false
end
end
script.Parent.Parent.Parent.ClickDetector.MouseClick:connect(bedlight)
When I click try to click the switch in-game, it won't let me! Please help if you can. Thanks in advance.
