|
| 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 |
|
|
|
| 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 |
|
|
|
| 29 Mar 2014 02:34 PM |
| How do I change the team of the random player that script has selected? |
|
|
| Report Abuse |
|
|