Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a team splitter?

Asked by
Uroxus 350 Moderation Voter
10 years ago

So I wana make a script that picks a sertain number of people from the entire server to become part of one team and the others to be on another, But also to have the Team Names on the leaderboard. Any ideas how I would go about doing this, Thanks in advance.

1 answer

Log in to vote
0
Answered by
yurhomi10 192
10 years ago
players = game.Players:GetChildren()  -- gets current players
randomp = players[math.random(#players)]  -- picks random player
print(randomp.Name .. " is it") -- tells us who the random player is
--stuff for it player or random
for i,v in pairs(players)  do -- iterate the player table
    if v.Name ~= randomp.Name then -- whoever isn't 'it', will tell us who isn't
        print(v.Name .. " is not it") -- tells us who
            --stuff if not it
    end
end
Ad

Answer this question