[Wiki needs updating] All player yield functions now cache?

Note: - There may be other factors such as location that will disprove my idea, but if a mod can update the wiki it’d be helpful (read the bottom comment). :slightly_smiling_face:

Just done some quick testing and to my suprise, the yield functions of player such as :GetRoleInGroup() and :GetRankInGroup() now cache even when they’re called on the client… The wiki still says that :GetRankInGroup() will only get out-of-date information if it’s run on the server, and that running it on local scripts should get the most up-to-date information. I don’t know whether this is actually something roblox has changed, but I was running the following code on a local script in a game, just to test for a much bigger project, and after changing someone’s rank in a group, it didn’t seem to update in-game.

while true do
	for i,v in pairs(game:GetService('Players'):GetPlayers()) do
		warn(v.Name,v:GetRoleInGroup(2621202),v:GetRankInGroup(2621202))
	end
	wait(5)
end

This first came to my attention when someone said in a game I made, “didn’t the overhead tags used to update instantly.” - :GetRoleInGroup() never used to cache on the server either, it doesn’t have the same warning on the wiki as :GetRankInGroup().

If anyone can shed some light on the situation, it’d be greatly appreciated, or I might have to start using something like the group service.

Wiki links
https://wiki.roblox.com/index.php?title=API:Class/Player/GetRoleInGroup
https://wiki.roblox.com/index.php?title=API:Class/Player/GetRankInGroup

From my memory, it has always had this behavior.

And from personal knowledge, :GetRoleInGroup on the server & client, and :GetRankInGroup() on the client used to get the most up-to-date information.

Those pages were last revised on August 2014.

The notes for GetRankInGroup say that this isn’t cached for LocalScripts. That may be what you’re thinking.

I know it says it isn’t cached for local scripts, if I wasn’t clear enough; it is now caches for local scripts based on my testing.

Well, it’s been documented to have that behavior since 2014. I think you’re remembering things wrong.

So you’re telling me, that :GetRankInGroup() ir :GetRoleInGroup() on a local script no longer gets the most up-to-date information?

1 Like

Aaah, okay, I misread.

I’ll try making a repo of this.
Yep. Caches. Related: Player:IsInGroup() and similar functions not always working properly

1 Like

Yeah, I noticed this before, this thread also mentions that :GetRoleInGroup() locally no longer recieves the most up-to-date information either.

I done a fair bit of testing on this and it seems like there’s no method without going into the HTTP service or Groups Service of getting the most up-to-date information of a player’s rank or role in a group with the player yield functions.

Looks like we’ll have to wait for Roblox, if they do anything about this, because I found this out the other day, that my ‘insant’ role scripts weren’t working, would help if roblox told us if they have intentionally done this but maybe there are just so many groups now that roblox can’t get the most up-to-date information but I think that unlikely.

Gonna try something with groups services, will probably just mean its gonna take a longer time to get that rank and role information.

Also, it’d be appreciated if someone could update this on the wiki :slight_smile:

@Maximum_ADHD ?
(sorry to ping, just saw them say it would be good if the wiki were updated)

1 Like

Okay, sorry to bring back a dead thread, but to solve my initial problem with the delay between changes in ranks in a group, the GroupService updates roles and ranks instantly on both the server and the client, so if anyone else ever needs to have group roles update instantly in a game, I’d suggest designing your code to work with that. (I now have to re-write a lot of group-related code)

Note: roblox might have actually fixed/removed the delay from :GetRoleInGroup or :GetRankInGroup() but I haven’t tested it and I’m pretty sure they haven’t.