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

Taking random player headshot with image label?

How can i use image label to show up random player face per custom time?

1 answer

✓ Accepted answer

You can use GetUserThumbnailAsync(playerId,thumbnailtype,thumbnailsize), which returns the image of a player character.

A PlayerId can be found as property of a player object. To get a random playerid on the server, you can use local players = game.Players:GetChildren() local randomplayerid = players[math.random(1,#players)].PlayerId.

For the thumbnailtype, Enum.ThumbnailType.HeadShot is the one that shows a player head and face.

For the size, you can choose it using Enum.ThumbnailSize.

For more info about the function go to roblox API https://developer.roblox.com/en-us/api-reference/function/Players/GetUserThumbnailAsync.

1 comment

0

There is also a way to iterate a playerimage addres to a playerid, although I dont remember the address.

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