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: Non-number randoms?

Previous Thread :: Next Thread 
weewoo5 is not online. weewoo5
Joined: 25 Oct 2009
Total Posts: 2281
17 Dec 2013 04:35 PM
Do such things exist?
Report Abuse
weewoo5 is not online. weewoo5
Joined: 25 Oct 2009
Total Posts: 2281
17 Dec 2013 04:38 PM
bump
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
17 Dec 2013 04:39 PM
MyList = {CFrameValue, StringValue, ObjectValue]

TheRandomThingFromMyList = MyList[math.random(#MyList)]
Report Abuse
dog456pop248 is not online. dog456pop248
Joined: 24 Aug 2008
Total Posts: 3977
17 Dec 2013 04:40 PM
MyList = {CFrameValue, StringValue, ObjectValue} -- oops I put a bracket there instead of a fancy curvy bracket, just fixed it.

TheRandomThingFromMyList = MyList[math.random(#MyList)]
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Dec 2013 04:52 PM
local randomsYouWant = {"a", "b", "pi", "test", ...}
print(randomsYouWant[math.random(randomsYouWant)])
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Dec 2013 04:52 PM
print(randomsYouWant[math.random(#randomsYouWant)])*
Report Abuse
weewoo5 is not online. weewoo5
Joined: 25 Oct 2009
Total Posts: 2281
19 Dec 2013 02:12 PM
eh, I knew that, I was kinda hoping for like random(Workspace.p1, Workspace.p2), its simpler.
Report Abuse
GGGGG14 is not online. GGGGG14
Joined: 29 Jan 2012
Total Posts: 25344
19 Dec 2013 02:23 PM
Maps? Here:

Maps = {}
for _, work in pairs(game.Workspace:GetChildren()) do
if string.lower(work.Name:sub(1,3)) == "map" then
table.insert(Maps,work)
end
end

RandomMap = Maps[math.random(1,#Maps)]
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