Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would you use stuff like GetRoleInGroup() on a Player that isn't in the same server as you?

I was wondering if anyone can tell me how you'd use stuff like GetRoleInGroup() on a Player that isn't in the same server as you, in a different game, or offline. I've tried local Player = game.Players:GetNameFromUserIdAsync(40973680) print(Player:GetRoleInGroup(7013)), and it get's the Player but it won't print their rank instead it returns the error attempt to call method 'GetRoleInGroup' (a nil value). Would this be possible in a ROBLOX game or would it require HttpService(API or something)?

Script I've tried:

local Player = game.Players:GetNameFromUserIdAsync(40973680)
print(Player:GetRoleInGroup(7013))

Any help appreciated, sorry I can't really explain it any better.

2 comments

0

I think you need to use their ID instead of their Name.

0

What?

1 answer

✓ Accepted answer

It is possible, however not by traditional methods. ROBLOX provides their API use for all users to use within their games. Using the group portion of their API, you can retriever all of the groups a user is in. To get the specific group, you'd need to loop through the table it returns, figure which id matches the one you're targetting, then proceed from there. Using GetAsync, you'd retrieve the informataion from the ROBLOX API. Best of luck.

This discussion is preserved as it was. New answers, comments, and votes are closed.