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 » Game Design
Home Search
 

Re: Please Help, Script Problems.

Previous Thread :: Next Thread 
BotBit is not online. BotBit
Joined: 05 Jan 2015
Total Posts: 163
10 Jan 2015 08:48 AM
plrs = game.Players:GetPlayers()

for _, plr in pairs(plrs) do
randomPlr = math.random(1,#plrs)
chosenPlr = plrs [randomPlr]
print(chosenPlr.Name)
end

Am I doing this right so far? I am making a script to pick a random player then teleport him somewhere, could someone assist me with this please, I am stuck.
Report Abuse
MrNoobe123 is not online. MrNoobe123
Joined: 14 Nov 2014
Total Posts: 153
10 Jan 2015 08:49 AM
Test it...

Lrn 2 cod lua m8
Report Abuse
BotBit is not online. BotBit
Joined: 05 Jan 2015
Total Posts: 163
10 Jan 2015 08:51 AM
It works, I just need someone to guide me through how to make this, I am trying to learn scriptin m8.
Report Abuse
MrNoobe123 is not online. MrNoobe123
Joined: 14 Nov 2014
Total Posts: 153
10 Jan 2015 08:52 AM
So someone wrote it for you...

Lrn 2 cod lua m8
Report Abuse
BotBit is not online. BotBit
Joined: 05 Jan 2015
Total Posts: 163
10 Jan 2015 08:54 AM
No, I had someone teaching me this last night, no one just wrote it for me, they helped me write it. I need someone to guide me through the rest.
Report Abuse
MrNoobe123 is not online. MrNoobe123
Joined: 14 Nov 2014
Total Posts: 153
10 Jan 2015 08:56 AM
Why not learn to code the rest, not many people would teach you for free.

Lrn 2 cod lua m8
Report Abuse
BotBit is not online. BotBit
Joined: 05 Jan 2015
Total Posts: 163
10 Jan 2015 08:58 AM
I am not asking to be taught for free, I will pay, but I was more asking for someone to lead me through places to find where to do this, I don't know where to look on the wiki.
Report Abuse
BotBit is not online. BotBit
Joined: 05 Jan 2015
Total Posts: 163
10 Jan 2015 09:24 AM
Anyone?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
10 Jan 2015 09:54 AM
I won't "teach" you because I do not dedicate my time like that, but I will help you find what you need or help explain something if you PM me.

--Set the varaible "plrs" to be a list of the current players in the server.
--http://wiki.roblox.com/index.php?title=API:Class/Players/GetPlayers
plrs = game.Players:GetPlayers()

--Get a random number between 1 and the number of players in the list.
--http://wiki.roblox.com/index.php?title=Function_dump/Mathematical_functions#math.random
randomPlr = math.random(1,#plrs)

--Get the player from the list based on the random number above.
--If the number was 2, then it would get the second player on our list.
--The list doesn't match the PlayerList in the game.
chosenPlr = plrs [randomPlr]

--Print the chosen player's name to the console.
print(chosenPlr.Name)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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