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: How do you pick a random value out of a table.

Previous Thread :: Next Thread 
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
07 Apr 2015 02:17 PM
So for example:

(If I'm doing this right.)

local sirens = {workspace.siren1,
workspace.siren2,
workspace.siren3
}

I want it to pick one of the sirens randomly per say.

Thanks for the help guys, I appreciate it.
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
07 Apr 2015 02:19 PM
b1
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
07 Apr 2015 02:21 PM
Here's an example of one I use for maps, see if you can figure out how to apply that to your sirens.

Maps = game.ServerStorage.Maps:GetChildren()
ranGame = math.random(1, #Maps)
gameChosen = Maps[ranGame]

Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
07 Apr 2015 02:21 PM
local Random = sirens[math.random(1,2)]


Total Posts: 404 ---------- Not Found
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
07 Apr 2015 02:22 PM
I understand it.

gracias.
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
07 Apr 2015 02:22 PM
KLink's is better. I just gave general idea


Total Posts: 404 ---------- Not Found
Report Abuse
Klink45 is not online. Klink45
Joined: 06 Jun 2011
Total Posts: 26054
07 Apr 2015 02:23 PM
You're welcome.
Report Abuse
Dralian is not online. Dralian
Joined: 21 Mar 2013
Total Posts: 7624
07 Apr 2015 02:30 PM
They're both good.

Thanks.
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