Alright so I made a brick to become a conveyer. I wanted it to be where when you sat down on a seat the GUI for the convayer controls would appear. I made a text button so when you click it would start and the text color would become green. When you click it again it would be red. I'm not sure about how to make it change colors but what is the command to put in our script to say "When the button is clicked, the conveyer will start and the color will turn green?"
ding = game.Lighting.CheckIn.TextButton function conveyer() if clicked = then --MY TROUBLE end
Thanks guys. Bad scripter here :3
To achieve this, we need to get some basic understandings down. Let's start with an if statement.
An example of an if statement would be:
x = 1 if x == 1 then print("This would print") else print("This wouldn't, since x is 1.") end
This if statement would have the output of:
This would print
x = 2 -- Change it, and see what happens. if x == 1 then print("This would print") else print("This wouldn't, since x is 1.") end
Now our output would be:
This wouldn't, since x is 1
All Gui TextButtons have this event. It fires whenever the left mouse button is clicked down.
script.Parent.MouseButton1Down:connect(function (onClicked) -- Code goes here. end)
I'm not going to provide an actual script in an attempt to allow you to learn. Be sure to check the wiki and search for "TextButton" so you can see examples of changing colors.