I'm just barely getting into scripting and I was wondering on how I assign a certain player name a team when they join. Thanks.
-Jordi
I'm just barely getting into scripting and I was wondering on how I assign a certain player name a team when they join. Thanks.
-Jordi
local turns
local random
local times = 8 -- Amount of times to randomize the counts
game.Players.PlayerAdded:connect(function(player)
random = math.random(1, 2)
while true do
if random == 1 then
turns = turns + 1
if turns == times then
player.Team = RED
return
end
elseif random == 2 then
turns = turns + 1
if turns == times then
player.Team = BLUE
return
end
end
end
end)
PS. Didn't test this code!
Edit: Did fix!
This discussion is preserved as it was. New answers, comments, and votes are closed.