Whats up with this script?
Whats up with this script? Im trying to make it so when a brick is clicked it would turn a light on the first time the brick gets clicked it would turn the light on. And the second time it gets clicked the light would turn off here heres script
01 | local button = script.Parent |
02 | local function lightOn() |
03 | game.Workspace.(NAMEOFBRICKHEE).(NAMEOFBRICKHERE).PointLight.Enabled = true |
04 | game.Workspace.(NAMEOFBRICKHERE).(NAMEOFBRICKHERE).NAMEOFBRICKHERE = BrickColor.new( "White" ) |
07 | local function lightOff() |
08 | game.Workspace.(NAMEOFBRICKHERE).(NAMEOFBRICKHERE).PointLight.Enabled = false |
09 | game.Workspace.(NAMEOFBRICKHERE).(NAMEOFBRICKHERE).BrickColor = BrickColor.new( "Black" ) |
12 | button.ClickDetector.MouseClick:connect(lightOn) |
13 | button.ClickDetector.MouseClick:connect(lightOff) |