Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how do i make it so that it automaticly puts people in a team depending on their rank id?

My group id is 9581199 and when someone joins whos rank is above or equal to 3 it puts them in the Staff team and when they are below that or they are not in the group put them in the passengers team.

1 answer

You can use the function Player:GetRankInGroup. Source of Player:GetRankInGroup here.

Script:

game.Players.PlayerAdded:Connect(function(Player)
    if Player:GetRankInGroup(9581199) == 3 or > 3 then -- GroupId inside the bracket, RankId at the right side
        print(Player .."is a staff / above a staff team!")
    else
        print(Player .."is not a staff / above a staff team!")
    end
end)

I don't know if this is right, or should've be fixed. But if this was helpful, please mark this as an answer! Thanks for reading.

This discussion is preserved as it was. New answers, comments, and votes are closed.