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!

local Players = game:GetService("Players")

local player = Players[workspace.TimeFI.seeker.SeekerName.Value]

-- Fetch the thumbnail
local userId = player.UserId
local thumbType = Enum.ThumbnailType.HeadShot
local thumbSize = Enum.ThumbnailSize.Size420x420
local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)

-- Set the ImageLabel's content to the user thumbnail
local imageLabel = script.Parent
imageLabel.Image = content
imageLabel.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