|
| 02 Jun 2012 10:49 AM |
WHAT IT DOES ALREADY: I'm making a script that, when clicked, will check if a certain script is disabled, if not then it changes the color of the brick containing the script and then disabled the script that it first checked to see if it was disabled.
WHAT I WANT IT TO DO: I want to figure out how to change the code to make it so if the script it checked for being disabled is disabled then it will do a different set of actions.
Could anyone please show or tell me how to make this kind of change so the script will do what I want it to do?
THE CODE: function onClicked(mouse) if script.Parent.Parent.Spawner.Drop.Script.Disabled ~= true then script.Parent.BrickColor = BrickColor.new("Bright red") script.Parent.Parent.Spawner.Drop.Script.Disabled = true end end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 02 Jun 2012 10:58 AM |
| What you are looking for are known as `else` and `elseif` as shown here ( http://wiki.roblox.com/index.php/Conditional_statements ) all you would half to do is add an `else` and then the code. `elseif` if you want to check another condition. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2012 11:04 AM |
| Thanks. I know that was a pretty simple question but frankly I'm terrible at scripting and worse at using the wiki! Your explanation helped a lot. Thank you Rayoma. |
|
|
| Report Abuse |
|
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 02 Jun 2012 11:08 AM |
| No problem. And the wiki is fairly easy to use once you get the hang of it. Also I had started attempting to make a test on the wiki to help you find articles that you're looking for however I only made a small sample to get opinions on it. Maybe I'll finish it... |
|
|
| Report Abuse |
|
|