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

How to find a certain players thumbnail?

Asked by 4 years ago

So I need for an image to show a certain players thumbnail. The players name that I need to show is the variable SeekerName.Value. Can anybody help me figure out how to tell the script to locate the player named SeekerName.Value and then get their thumbnail? Thanks!

01local Players = game:GetService("Players")
02 
03local player = Players[workspace.TimeFI.seeker.SeekerName.Value]
04 
05-- Fetch the thumbnail
06local userId = player.UserId
07local thumbType = Enum.ThumbnailType.HeadShot
08local thumbSize = Enum.ThumbnailSize.Size420x420
09local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
10 
11-- Set the ImageLabel's content to the user thumbnail
12local imageLabel = script.Parent
13imageLabel.Image = content
14imageLabel.Size = UDim2.new(0, 420, 0, 420)
0
if `workspace.TimeFI.seeker.SeekerName.Value` returns the name of a player in the server, then this should work.. User#23252 26 — 4y

Answer this question