local Players = game:GetService("Players")
local GetPlayers = game.Players:GetPlayers()
local localPlayer = GetPlayers[math.random(1, #GetPlayers)]
local UserId = localPlayer.UserId
local ThumbnailSize = Enum.ThumbnailSize.Size420x420
local ThumbnailType = Enum.ThumbnailType.HeadShot
local content = Players:GetUserThumbnailAsync(UserId, ThumbnailSize, ThumbnailType)
local Image = script.Parent
Image.Image = content
✓ ANSWER ACCEPTED
How to pick random player and get his picture?
1 answer
✓ Accepted answer
GetUserThumbnailAsync() takes ThumbnailType as its second argument and ThumbnailSize as its third. You have them switched.
1 comment
0
Thanks you.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
Where is this script executing? Is it in the server?
game.StarterGui.ScreenGui.ImageLabel This is local script
What exactly is going wrong with it? Is it printing out an error or what?
Error: Unable to cast token to token
There's no information in what line I make something wrong.