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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: C# Help

Previous Thread :: Next Thread 
HatHelper is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
11 Feb 2013 03:38 PM
Can anyone convert this into Lua? I have no idea what '?' ':' are, and how '!='(which I'm assuming is 'not') works

x=5
a = random(AA * ( ( x % 11 != 10 ) ? 2 : 1 ),
BB * ( ( x % 11 != 10 ) ? 2 : 1 ))
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
11 Feb 2013 03:49 PM
I think != is either greater than or less than.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
11 Feb 2013 03:50 PM
? and : are ternary operations.

x=5
a = random(AA * ( ( x % 11 != 10 ) ? 2 : 1 ),
BB * ( ( x % 11 != 10 ) ? 2 : 1 ))

Lua:

x=5
a = math.random(AA * ( ( x % 11 ~= 10) and 2 or 1),
BB * ( ( x % 11 ~= 10) and 2 or 1))
Report Abuse
HatHelper is not online. HatHelper
Top 25 Poster
Joined: 02 Mar 2009
Total Posts: 46305
12 Feb 2013 02:56 PM
Thanks crazy, appreciate 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