Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My light isnt working. Help me fix this?

Asked by 9 years ago

Well i have a light, but only one works. i noticed only one works when i added 14 more and the switch i beleve its the script because only one works

--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("Bright 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 ANOTHER function ToggleLight() if script.Parent.Parent.LightState.Value == false then script.Parent.Parent.LightState.Value = true script.Parent.BrickColor = BrickColor.new("Bright green") script.Parent.Parent.Light.BrickColor = BrickColor.new("White") script.Parent.Parent.Light.SpotLight.Enabled = true else script.Parent.Parent.LightState.Value = false script.Parent.BrickColor = BrickColor.new("Bright red") script.Parent.Parent.Light.BrickColor = BrickColor.new("Black") script.Parent.Parent.Light.SpotLight.Enabled = false end end

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

IDK how to explain and sorry for my grammer its really hard to explain

Answer this question