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

Auto-Team

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

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

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.

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