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?
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
Marked as Duplicate by Shawnyg
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?