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: How can I make this work?

Previous Thread :: Next Thread 
TelamonLikenoname is not online. TelamonLikenoname
Joined: 03 Feb 2010
Total Posts: 91
04 Feb 2012 06:56 PM
function v(t)
return t(math.random(1,#t))
end
t2={"yo","yoo"}
l=v(t2)
print(l)

~sharky99
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
04 Feb 2012 06:57 PM
WOW, what are you trying to do because that is one BAD script...
Report Abuse
TelamonLikenoname is not online. TelamonLikenoname
Joined: 03 Feb 2010
Total Posts: 91
04 Feb 2012 07:02 PM
Flappy, you suck.


it returns a random table value out of its parameter 't' which is a table, in this case, t2. I made it like this so I can just use one function to return a value of a series of tables.
Report Abuse
TelamonLikenoname is not online. TelamonLikenoname
Joined: 03 Feb 2010
Total Posts: 91
04 Feb 2012 07:03 PM
nevermind, I fixed it myself...

function v(t) return t[math.random(1,#t)]end t2={"yo","yoo"} l=v(t2) print(l)
Report Abuse
blueymaddog is not online. blueymaddog
Joined: 23 Sep 2009
Total Posts: 5459
04 Feb 2012 07:05 PM
if you put spaces inbetween it looks more neat and ledgible
Report Abuse
flappydavid is not online. flappydavid
Joined: 03 May 2009
Total Posts: 5893
04 Feb 2012 07:05 PM
Wow, you suck for saying I suck. By the logic you got that wrong you suck. Noob.
Report Abuse
TelamonLikenoname is not online. TelamonLikenoname
Joined: 03 Feb 2010
Total Posts: 91
04 Feb 2012 07:06 PM
Sorry, I should have re-read what I scripted, I assumed I had brackets there so it looked like a function... My bad...
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