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: Need help for my game[SCRIPT PROBLEM]

Previous Thread :: Next Thread 
ExcelarateX is not online. ExcelarateX
Joined: 22 Jun 2011
Total Posts: 444
29 Mar 2014 02:07 PM
I'm new to all this scripting so I'm pretty rubbish at it I'm making a infection game and one of the script there is to select a random person from a Team and change it into another team here's what I've made so far:

function infect_lobby_member()
infect = game.Players <--- I need help to make a script to select a random player <--- I also need help to make a script that changes the randomly selected player's Team
end
print(infect)
infect_lobby_member()
Can someone help me?

~Ex
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 02:08 PM
to select a random player do..

math.randomseed(tick())
local players = game.Players:GetPlayers()
local infect = players[math.random(#players)]
print(infect.Name)

#nerdsunited
Report Abuse
ExcelarateX is not online. ExcelarateX
Joined: 22 Jun 2011
Total Posts: 444
29 Mar 2014 02:34 PM
How do I change the team of the random player that script has selected?
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