function ToggleLight()if script.Parent.Parent.Parent.LightState.Value==false then script.Parent.Parent.Parent.LightState.Value=true script.Parent.BrickColor=BrickColor.new("\083\101\097 \103\114\101\101\110")script.Parent.Parent.Parent.Lamp.Light.BrickColor=BrickColor.new("\087\104\105\116\101")script.Parent.Parent.Parent.Lamp.Light.SpotLight.Enabled=true else script.Parent.Parent.Parent.LightState.Value=false script.Parent.BrickColor=BrickColor.new("\066\114\105\103\104\116 \114\101\100")script.Parent.Parent.Parent.Lamp.Light.BrickColor=BrickColor.new("\066\108\097\099\107")script.Parent.Parent.Parent.Lamp.Light.SpotLight.Enabled=false end end script.Parent.ClickDetector.MouseClick:connect(ToggleLight)
--Working lightswitch.

function ToggleLight()
	if script.Parent.Parent.Parent.LightState.Value == false then
		script.Parent.Parent.Parent.LightState.Value = true
		script.Parent.BrickColor = BrickColor.new("Sea green")
		script.Parent.Parent.Parent.Lamp.Light.BrickColor = BrickColor.new("White")
		script.Parent.Parent.Parent.Lamp.Light.SpotLight.Enabled = true
	else
		script.Parent.Parent.Parent.LightState.Value = false
		script.Parent.BrickColor = BrickColor.new("Bright red")
		script.Parent.Parent.Parent.Lamp.Light.BrickColor = BrickColor.new("Black")
		script.Parent.Parent.Parent.Lamp.Light.SpotLight.Enabled = false
	end
end

script.Parent.ClickDetector.MouseClick:connect(ToggleLight)
