For example , your in a game and there's 3 teams : Owner , Co-Owner and Member , So in the group there's 3 roles : Owner , Co-Owner and member , so when u join the game , It's going to check what rank u have in the group and auto assign the team for you.
local groupid = 0 game.Players.PlayerAdded:Connect(function(Player) if Player:GetRankInGroup(groupid) == 255 then -- change 255 with your wanted rank ! Player.Team = game.Teams.Example -- change Example to your team name! end end) -- e.g game.Players.PlayerAdded:Connect(function(Player) if Player:GetRankInGroup(groupid) == 200 then Player.Team = game.Teams.Soldier end end)