Group Team Auto Assign script not working (2nd post)

I made a post recently about my not working group team auto-assign.

It worked when I fixed that but now it broke again when I added some more scripts and changed it.

		if player:GetrankInGroup(9659028) > 249 then
			player.Team = game.Teams["Army Staff"]
			player:LoadCharacter()
		elseif player:GetrankInGroup(9659028) > 20 then
			player.Team = game.Teams["Headquarters"]
			player:LoadCharacter()
	    elseif player:GetrankInGroup(9667328) > 1 then
		   player:LoadCharacter()
		   player.Team = game.Teams["Training & Doctrine Command"]
     	elseif player:GetrankInGroup(9667328) > 1 then
	    	player:LoadCharacter()
	     	player.Team = game.Teams["Military Police Corps"]
	  	    player:LoadCharacter()
		elseif player:GetrankInGroup(9659028) > 2 then
			player.Team = game.Teams["Personnel"]
			player:LoadCharacter()
		else
			player.Team = game.Teams["Civilian"]
			player:LoadCharacter()
		end
	end)

It does not team me right and I don’t spawn at the right place, I don’t know if it has something with LoadCharacter to do but I’m not sure.

Please help if you know what the problem is, otherwise have a good day.

1 Like

Functions are case-sensitive, so it should be player:GetRankInGroup instead

2 Likes

Alternatively, you could use:

player:GetRoleInGroup()
1 Like

Thanks for your help, have a good day.

1 Like