With GroupService:GetGroupsAsync you’re able to check Name, ID, Rank and more. while IsinGroups checks if that player is in group.
for i,v in pairs(GroupService:GetGroupsAsync(Player.UserId)) do
if v.ID == 000000001 and v.ID == 000000002 then
print("Yay")
end
end
if Player:IsInGroup(000000001) and Player:IsInGroup(00000002) then
print("Yay")
end
This basically works the same but one uses the table and the other can’t check player Group Primary and the name, but which is API is more better?
GetGroupsAsync doesn’t cache so GetGroupsAsync. It also allows me to make cache, rank refresh and permissions systems whenever I want to frequently read a user’s groups and/or their standings in those groups. For example, I might allow the user to have a refresh button if they get promoted while playing so they can immediately start doing activities with their new ranks.
I find that using the player methods (IsInGroup, GetRankInGroup and GetRoleInGroup) is just a weirdly bad habit and they don’t work for my use cases where I prefer having a cache that I can control. In new work I never use the latter two/three.