I was trying to make 2 buttons which would turn on or off the generators.
But if you know LUA and isn't a beginner, You can see that I pretty much screwed up.
1 |
function onClicked(playerWhoClicked) game.Lighting.Ambiet = [0,0,0] end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
There wasn't anything in the Output related to this.
i think this is what you want make a model with 2 parts in them name 1 of them OnPart and the other 1 OffPart and within those parts put a clickdetector in them and also put a script in the model Putting everything up and what you want to write in the code is this
1 | script.Parent.OnPart.ClickDetector.mouseClick:connect( function () |
2 | game.Lighting.Ambient = Color 3. new( 255 / 255 , 255 / 255 , 255 / 255 ) |
3 | end ) |
4 | script.Parent.OffPart.ClickDetector.mouseClick:connect( function () |
5 | game.Lighting.Ambient = Color 3. new(- 255 / 255 ,- 255 / 255 ,- 255 / 255 ) |
6 | end ) |
if you did everything i said correctly then you would get this as your result Result