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

Is there a way to do the equivalent of GetRank/RoleInGroup without a player object? [answered]

I am creating a point system for management of the players and their ranks.

I want a player to be searched, then have their group data show up (rank id, the rank's name, etc.). The functions I mentioned in the title only work with player objects - is there anything else I could do?


Thank you!

~TDP


EDIT:

I was looking through the wiki when I came across this service, and one particular function:

GetGroupsAsync(userId)

(link)

It returns an array of groups a player is in, and each entry has the following (relevant) information:

  • Rank
  • Role
  • GroupId (for checking if it is the correct group)

2 answers

Theres a method called game.Players:GetPlayerFromUserIdbut I dont know if that'll work when the player isnt there in the first place. Try it.

2 comments

0

Not sure if that would return a player if the player wasn't in game. I'm not sure though. Good suggestion.

0

The function returns nil if the player is not in game. For future reference, why don't you try doing a wiki search? ROBLOX is really stupid sometimes - there is literally no usage for this function apart from shortening something that I have never felt the need to do before.

You could try the Roblox Web Api, but you need to have sufficient knowledge in how to grab the result you want

Find the Wiki Article here

Good luck!

1 comment

0

I'll try this if LifeInDevelopment's answer did not help, thanks!

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