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

Should you use pcall when getting a users thumbnail??

So basically i'm using the function "GetUserThumbnailAsync()" to get the users player thumbnail. But i'm not sure if i should wrap it in a pcall. Since it makes a web request(I think not sure). I obviously dont want my script to break because the function failed. So. Should i wrap it in a pcall to be safe?

Script if you need it:

item.IMAGE.SurfaceGui.ImageLabel.Image = game.Players:GetUserThumbnailAsync(plr.UserId, Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size420x420)

1 answer

✓ Accepted answer

The answer is No, it's not important to wrap it in a pcall function. Even if it fails due to server errors, it will not break the script. It will cause a warn function to inform that it couldn't fetch the image.

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