Group Rank not working

Hello! I´m trying to make text change if players have rank 6+ in group (Group ID: 5104718) text in GUI will change, however this script doesnt work for some reason (no errors)

Script
game.Players.PlayerAdded:Connect(function(Player)
	if Player:GetRankInGroup(5104718) >= 6 then 
		script.Parent.TextLabel.Text = "RoO 2.0"
		script.Parent.ImageColor3 = Color3.fromRGB(255, 255, 255)
	end
end)

Anyone know why?

If this is a localscript:
The player is created before the localscript, hence: your PlayerAdded event won’t run.

If this is a serverscript:
Use a localscript to deal with UI-related things, the server is not meant to do such things.
I would recommend using a RemoteEvent and use the method FireClient().


Also, the rank is cached on the server-side (in case you did not know).
You could always look into GroupService though,
to avoid this type of caching-behavior on GetRankInGroup().

1 Like

Yes, i use localscript… Is there any way to get around it? Maybe waiting for game to load?

  1. GroupService or Player:GetRankInGroup > Check their rank in the group.
  2. RemoteEvent > FireClient() if condition is met.
  3. RemoteEvent > OnClientEvent.
1 Like

Doesnt work anyways, no errors in console

If you’re doing what I suggested, it would work perfectly fine.

1 Like