I have made a script to make a GUI only enabled to certain ranks but when I test it, it always comes up in output as ServerScriptService.Script:6: attempt to index nil with 'GetRoleInGroup'.
local role = 4
local groupId = 5868343
local player = game.Players.LocalPlayer
if player.GetRoleInGroup(groupId) >= role then
player.PlayerGui.Handto.Enabled = true
end

1 comment
You have to use a : and you have to use Rank since thats the rank number, and Role is the role name. So, it's like this. if player:GetRankInGroup(groupId) >= role then