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 » Scripters
Home Search
 

Re: i forgot this

Previous Thread :: Next Thread 
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
26 Aug 2016 09:03 PM
something = true

print(something == true and true or false)

which one acts as elseif/else?


This siggy is copyrighted ©
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
26 Aug 2016 09:04 PM
what
the or means that if the condition is not true then...

Formerly ToxicDominator - add 17,509 posts
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
26 Aug 2016 09:05 PM
print(something == true and 'it is true!' or something == false and 'it is false' or 'where am i')


send me trades
Report Abuse
WoolHat is not online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
26 Aug 2016 09:06 PM
The or is what you're looking for.
print(false or 5) -> 5
print(true or 5) -> true

And requires both left and right statements be truthy. Or goes to the right statement if the left isn't truthy.
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
26 Aug 2016 09:12 PM
Would this work

local random = math.random(1,3)
print((random == 1) and 1 or (random == 2) and 2 or random == 3 and 3)


This siggy is copyrighted ©
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
26 Aug 2016 09:14 PM
why don't you just do
print(random)


send me trades
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
26 Aug 2016 09:16 PM
trying to make a number/letter generator with something similar to the above code stated in the OP (finished, works)


This siggy is copyrighted ©
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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