I am looking to make a game where there are teams, there would be a team of 1 person then a team of 3 people against each other. I am trying to make a system that randomly selects a player to be the team of 1 then puts the rest on the other team. Any help on how to do this?
✓ ANSWER ACCEPTED
How to randomly pick a player?
1 answer
✓ Accepted answer
local players = game:GetService("Players"):GetPlayers()
local randomPlayer = players[math.random(1, #players)]
math.random(1, #players) will get a random number between 1 and (however many players are in the server), and running a array[number] will get the (number)'th value in the array
This discussion is preserved as it was. New answers, comments, and votes are closed.
