generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I need help learning how to do ORs!

Previous Thread :: Next Thread 
Coopertroop4 is not online. Coopertroop4
Joined: 27 Jul 2008
Total Posts: 4617
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 is not online. 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
Coopertroop4 is not online. Coopertroop4
Joined: 27 Jul 2008
Total Posts: 4617
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image