- What do you want to achieve? Keep it simple and clear!
I want to retrieve the player’s groups using GroupService, then index through the result to find a specific group ID. If the group ID is found, I want to retrieve their rank from that group.
- What is the issue? Include screenshots / videos if possible!
The issue is that my script can’t index the specific group ID I’m looking for. The if-then statement returns false, and my else statement fires for all the groups (including my specific group).
** CODE **
staffFunction.OnServerInvoke = function(player, id)
local groups = GroupService:GetGroupsAsync(id)
for _, group in groups do
print(group)
if group.EmblemId == 6878947 then
print("I FOUND THE GROUP")
else
warn("Group does not exist")
end
end
end
IMAGES