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

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

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

✓ Accepted answer

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)

2 comments

0

ahh okay. i was putting a "." instead of ":"

0

You could still reference the function by indexing it instead of calling it as a method: Players.GetNameFromUserIdAsync(Players,id)

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