Player:IsInGroup() and similar functions not always working properly

Issues:

1: The wiki pages for Player:IsInGroup() and Player:GetRankInGroup() say the following:


However, this is not actually true - even when used in a LocalScript, these functions always just return cached results from when the player first joined the server, regardless of whether the player has left or joined the group mid-game.
This information should not be permanently cached when being requested from a LocalScript.

Player:GetRoleInGroup() only returns up-to-date results if the player is a member of the group upon joining the server. And if the player leaves the group mid-game, the function will continue to return “Guest” even if the player rejoins the group soon after.


2: Sometimes, even though a player is a member of the group, these functions will return results saying that the player isn’t in the group. This happens in both Scripts and LocalScripts.

I provide in-game incentives to players who join my group. I’ve gotten a handful of complaints from people who have been in the group for a long time but, one day, do not receive these benefits because of :IsInGroup() incorrectly returning “false” on both the server and the client. This issue is random and slightly infrequent on an individual level, but I have encountered this myself a few times and I get complaints from a few people each day about this happening.

This is not linked to any web/data outages, it just happens at random. It’s frustrating that these functions can return inconsistent results which can’t be corrected unless the player leaves and joins a different server.

6 Likes

I would really appreciate these features bring updated to be more accurate. I’m creating a system which will use these features, and expect then to be accurate as a built in API.

2 Likes

Seems very inconsistent:

  • If player is in a group, GetRoleInGroup is up-to-date
  • If player isn’t in group, GetRoleInGroup is cached

Your second problem shouldn’t happen.
Could you get the F9 when this happens?
Maybe it’s a HTTP error and just returns false as default.

2 Likes

I’m encountering the same issue as well. Player would have to rejoin the game so the IsInGroup() returns the latest info whether the player is really in the group or not. iI hope they’ll fix it

edit: IsInGroup() in both server and local script actually returns the latest info but only after waiting 1-2 minutes in game.