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)
6 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”)

1 Like

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

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

No, you would do it like this

if player:GetRankInGroup(GroupId) >= 252 then

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

Also I add the script to workspace or something else?

Serverscriptservice preferably

3 Likes