I need help making a script that randomly selects 2 players from the game and puts them on a team. Honestly, I've tried making the script myself, but it never works. I don't even know how to make the script, honestly, I just tried what I thought would work. Can anyone help?
local players= game.Players:GetChildren() local team = game.Teams.Team1 local plr1 = players[math.random(1,#players)] local plr2 repeat plr2 = players[math.random(1,#players)] until plr2 and plr2 ~= plr1 plr1.TeamColor = team.TeamColor plr2.TeamColor = team.TeamColor
Un-tested, hopefully works