How can I make auto team?

I have a cafe and I want to make teams like “HR” “TSHR” “MR” “LR”
I want to make like if player is 23 or more rank him/her MR.
But I dont know how to do that. Please help me.

1 Like

First you need to create the teams, you read this about how to make it. Then create a script and paste this code

game.Players.PlayerAdded:Connect(function(player)
    if player:IsInGroup(GroupId) then
        if player:GetRankInGroup(GroupId) >= rank then
            player.TeamColor = BrickColor.new("team color")
        elseif player:GetRankInGroup(GroupId) >= rank then --Keep copying and pasting this for each team
            player.TeamColor = BrickColor.new("team color")
        end 
    end
end)
7 Likes

Scripting support is mostly just for scripting checks, like if someones script comes out an error. I recommend researching how to script first. This might help with posts in the future: About the Scripting Support category. But, to answer your question, I agree with @Barty200 and recommend looking at the link he posted.

I used this script but it didn’t work.

GroupId = 5437199

game.Players.PlayerAdded:Connect(function(player)
if player:IsInGroup(GroupId) then
if player:GetRankInGroup(GroupId)252>= rank then
player.TeamColor = BrickColor.new(“team color”)

2 Likes

Change the GroupId to the Id of your group and change the team color to the corresponding colour of the team and replace rank with the rank you want

1 Like

I want like rank 252 gets HR, how can I do that?
if player:GetRankInGroup(GroupId)252>= rank then
Like this?

1 Like

No, you would do it like this

if player:GetRankInGroup(GroupId) >= 252 then
1 Like

Okay, thanks you helped me a lot! :smiley:

1 Like

Also I add the script to workspace or something else?

1 Like

Serverscriptservice preferably

3 Likes