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

Help make team switch script keep people from unbalancing teams?

Asked by 6 years ago

I want people to be able to switch teams and while it works, it doesn't stop people from unbalancing the teams, how do I make it so it stops people from joining teams larger than theirs.

function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Dark orange")
end


script.Parent.MouseButton1Down:connect(Click)

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
while true do
    wait(10) -- Delay of how many seconds it will start again
for i, v in pairs(game.Teams["White Team"]:GetPlayers())do -- change "White Team" To where you will get your players from to another team
v.Character.Head:Destroy() -- Resets the player instantly
wait(0) -- 0 seconds to how this script will repeat again
end
end

It works, But not might be a switcher ( Put the script in ServerScriptService )

If you are doing a Team Changer gui script then ( Adding Spawn's is your decision )

local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
player.TeamColor = BrickColor.new("Lime green") -- Change Lime Green to your team's color
player:LoadCharacter()
end)
Ad

Answer this question