--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)
