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

Return nil or error?

print(game.Players:GetNameFromUserIdAsync(20))

This returns a error.

Would this return nil if I used it like this?:

local Player = game.Players:GetNameFromUserIdAsync(20)
if Player then
[Stuff here]
end

20 is NOT a userId

1 answer

No, it would return an error. The use case doesn't modify the function.

2 comments

0

Hmm. Is there anyway to check if a number is a real UserId?

0

pcall

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