I need help trying to make it so if you have a certain rank in a group or higher, it makes you auto join a team. Fo example, if I am a SHR at a group, it makes me join Administration the moment I join the game.
game.Players.PlayerAdded:connect(function(newPlayer)
local rank = newPlayer:GetRankInGroup(0000000) --your group id
if rank == 255 then -- change to your rank number
--assign him to a team
end
end)
Or, you can use GetRoleInGroup()
game.Players.PlayerAdded:connect(function(newPlayer)
local rank = newPlayer:GetRoleInGroup(000000) --your group id
--do stuff
end)
Insert a team into Teams, make sure AutoAssignable is false,
and do this :
game.Players.PlayerAdded:connect(function(newPlayer)
local rank = newPlayer:GetRankInGroup(0000000) --your group id
if rank >= 254 then -- change to your rank number
local team = game.Teams["YOURTEAMNAME"]
if team and rank then
newPlayer.Team = team
end
end
end)