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

How do I use this pcall: GetUserIdFromNameAsync ?

1 answer

✓ Accepted answer

I assume you mean how do you call that function from within a pcall from your title.

Like any other way!

pcall(function()
	-- getuseridfromnameasync is a function of game.Players
	local userid = game.Players:GetUserIdFromNameAsync("RevergeHelps")
	-- print the result of the above function to output
	print(userid)
end)

As this is within a pcall, it will keep running even if it errors.

https://wiki.roblox.com/index.php?title=Pcall

https://wiki.roblox.com/index.php?title=API:Class/Players/GetUserIdFromNameAsync

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