I have a table of ID's that my game automatically checks through to see if you are friends with any certain people, but it is a long list, so is there any way I can get the username from one of the ID's?
Sure. This function
will return the username
from the given id
. :)
01 | function UserFromId(userId) |
02 | local userSets = game:GetService( "InsertService" ):GetUserSets(userId) --get the user's sets |
03 | for _,v in pairs (userSets) do --iterate through then |
04 | if v.Name = = "My Models" then --check if this is the player's models |
05 | return v.CreatorName --returning the name of the creator of the set "My Models" (the player) |
06 | end |
07 | end |
08 | end |
09 |
10 | print (UserFromId( 261 )) |
Locked by adark, M39a9am3R, and TurboFusion
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?