Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

does anybody know how to use this non descriptive page from wiki?

Asked by 7 years ago

this link to get name from a UserID

there's nothing about it. but im trying to get the name from a user id (without them being in game)

if there's something else. I couldnt find anything beside this.

1 answer

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

It's not too hard to understand. This is a function of the players service, the wiki informs us, so all we do is use the function.

local Players = game.Players

local id = 100

local nameOfPlayerWithId = Players:GetNameFromUserIdAsync(id)
print(nameOfPlayerWithId) --// baltimoreclarke

See? Not too hard.

You should use pcall for this in case the ID you provide isn't valid.

local succeeded, nameOfPlayerWithId = pcall(function()
    return Players:GetNameFromUserIdAsync(id)
end)
0
ahh okay. i was putting a "." instead of ":" RobloxianDestory 262 — 7y
0
You could still reference the function by indexing it instead of calling it as a method: Players.GetNameFromUserIdAsync(Players,id) Goulstem 8144 — 7y
Ad

Answer this question