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: Can you assign individual variables

Previous Thread :: Next Thread 
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 05:13 PM
to everything that was picked with math.random? ex
game.Players:GetPlayers()[math.random(1, #game.Players:GetPlayers())]
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 05:13 PM
Instead of 1, say 3..
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
17 Jan 2014 05:18 PM
I don't think you understand what you're saying.
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 05:20 PM
I don't think you understand Lua.
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 05:22 PM
For example....


Workspace:GetChildren()[math.random(3, #Workspace:GetChildren())]
Assigning a different variable for all three of those.
Report Abuse
PiggyJingles is not online. PiggyJingles
Joined: 13 Jan 2009
Total Posts: 2472
17 Jan 2014 05:25 PM
I don't think you understand Lua
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 05:28 PM
I don't need your negative replies. I simply asked for help and I get a rude reply...
Report Abuse
PiggyJingles is not online. PiggyJingles
Joined: 13 Jan 2009
Total Posts: 2472
17 Jan 2014 05:30 PM
Well you were being rude to Absurdism.
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
17 Jan 2014 05:34 PM
Workspace:GetChildren()[math.random(3, #Workspace:GetChildren())]

This will give you one userdatum, not three.
Report Abuse
gerov is not online. gerov
Joined: 05 Feb 2011
Total Posts: 5504
17 Jan 2014 05:41 PM
I was looking for how to do that too XD

Swag = Instance.new("Mudkipz")
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 07:39 PM
So i need to call it 3 individual times":?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Jan 2014 07:45 PM
Yes, and next time you want to tell someone they don't know Lua, learn it yourself.
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
17 Jan 2014 07:53 PM
I had a thought. You can't tell someone if they know something or not. And, let me ask you, how did you get into this?
Report Abuse
Azureous is not online. Azureous
Joined: 29 Jan 2012
Total Posts: 25287
17 Jan 2014 07:55 PM
local players = game.Players:GetPlayers();
local special = {};

local picked = players[math.random(#players)];
table.insert(special,picked);

Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Jan 2014 07:57 PM
This isn't the first time someone who wastes a lot (not in a bad way) of time creating a guide to learning Rbx.Lua was treated like this
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