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
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
No, it would return an error. The use case doesn't modify the function.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Hmm. Is there anyway to check if a number is a real UserId?
pcall