Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Changing a team?

I need a script that kills the players, then changes their team to "In the Blitz" which is the color Bright Blue. Here is what I tried...

while true do
wait(5)
function setTeam(player, teamName)
    player.TeamColor = game.Teams["In the Blitz"].TeamColor
    if player.Character then --Just in case the character doesn't exist for some reason
        player.Character:BreakJoints() -- Kills the players' character
    end
end

Thanks!

1 answer

A while true do loop will cause your game to crash. Also, you didn't properly define the player variable.

for i,plr in pairs(game.Players:GetChildren()) do
	plr.TeamColor = game.Teams["In the Blitz"].TeamColor
	plr.Character:BreakJoints()
end

This discussion is preserved as it was. New answers, comments, and votes are closed.