PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

How to Check a Player's Rank in a Group

How to Check a Player's Rank in a Group

Oct 01 2018, 1:37 AM PST

The code below will check if a player that has entered the game has a rank equal to 255, in a group with an ID of 2. If they are, it will print “Player is the owner of the group, ‘LOL’!”, otherwise “Player is NOT the owner of the group, ‘LOL’!” will be printed to the output.

game.Players.PlayerAdded:Connect(function(Player)
    if Player:GetRankInGroup(2) == 255 then
        print("Player is the owner of the group, 'LOL'!")
    else
        print("Player is NOT the owner of the group, 'LOL'!")
    end
end)