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

GetRoleInGroup

Returns the player’s role in the group as a string, or “Guest” if the player isn’t part of the group.

Parameters

Name Type Default Description

Returns

Return Type Summary

Code Samples


How to Check a Player's Role in a Group

The code below will print the name of the rank that the player is currently a part of, in a specific group. In this instance we’re checking what rank the player is within a group which has a group ID of 2.

game.Players.PlayerAdded:Connect(function(player)
    print("Player is ranked as '" .. player:GetRoleInGroup(2) .. "' in group, 'LOL'!")
end)