Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Taking random player headshot with image label?

Asked by 4 years ago
Edited 4 years ago

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

1 answer

Log in to vote
1
Answered by
Dfzoz 489 Moderation Voter
4 years ago
Edited 4 years ago

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.

0
There is also a way to iterate a playerimage addres to a playerid, although I dont remember the address. Dfzoz 489 — 4y
Ad

Answer this question