how do I make a team group rank script that if someone joins and that he is in this the group (2671856) any higher rank than 8 spawns in team called Officers and any lower ranks spawns in team Enlisted
and if player is not in group 2671856 he spawns in the team called Visitors
game.Players.PlayerAdded:connect(function(player) -- function is called when player joins game if player:GetRankInGroup(2671856) >= 8 then --checks if players rank in 2671856 is greater than or equal to 8 player.Team = "Officers" -- sets players team to officers elseif player:GetRankInGroup(2671856) < 8 then -- checks if players rank in 2671856 is smaller than 8 player.Team = "Unlisted" -- sets players team to unlisted else -- if player meets none of the above conditions player.TeamColor = "Visitors" -- set team to visitors end)