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

GetRankInGroup

Returns the player’s rank in the group as an integer between 0 and 255, where 0 is a non-member and 255 is the group’s owner.

Parameters

Name Type Default Description

Returns

Return Type Summary

int


Code Samples


How to Check a Player's Rank in a Group

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)