So , i'm trying to make a script that picks a player then picks another player.
local nF = game.Players:GetPlayers()[math.random(1,#game.Players:GetPlayers())]
rest of the code
`while wait() do progress = true print(nF.Name) for i =intime , 0, -1 do wait(1) text.Text = i end nF.TeamColor = game.Teams["Monster"].TeamColor nF.Character.HumanoidRootPart.CFrame = workspace.NeighborSpawn1.CFrame ` `for i =round , 0, -1 do wait(1) roundtime.Text = i end for _,players in pairs(game.Players:GetPlayers()) do players.TeamColor = game.Teams["Lobby"].TeamColor players.Character.HumanoidRootPart.CFrame = workspace.SpawnLocation.CFrame end`
GetPlayers will return a table of all the players, it essentially comes down to just picking a random value in a table.
local RandomPlayer = Players:GetPlayers()[math.random(#Players:GetPlayers())]