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

Auto-Team

Asked by 10 years ago

I am terrible at scripting but I need a script for my game. Can somebody tell me how to make a auto team script which does it by group ranks

2 answers

Log in to vote
2
Answered by
Freemium 110
10 years ago

Well, you'll want to use the PlayerAdded event.

game.Players.PlayerAdded:connect(function(plr)
--Code here
end)

You'll also want to use IsInGroup and GetRankInGroup method.

Now I want you to try to make it yourself as it helps you learn better. In order to help you better please answer these questions:

Do you know what an if statement is? Do you know how to use methods? Do you know how to change BrickColor using a script? Do you know the less than, greater than, less than or equal to, and greater than or equal to signs? Do you know how to compare equality? ex. Find out if 10 is equal to 10

Ad
Log in to vote
-1
Answered by 10 years ago

If you want being in a group to Auto-Team then this.

function assignTeam(player, groupId, teamName) if (player:IsInGroup(groupId) == true) then local team = game:GetService("Teams") if (team ~= nil) then local team2 = team:FindFirstChild(teamName) if (team2 ~= nil) then if (player.Parent ~= nil) then player.TeamColor = team2.TeamColor end end end end end

game.Players.PlayerAdded:connect(function(p) assignTeam(p, yourgroupid, "yourteamname") end)

If this doesn't meet your needs, Sorry, Try learning new methods.BrickColor,an If Statement,or Mathmatical signs.

Answer this question