Hey there, I'm currently making a system so when the player types a UserID it displays the thumbnail of that user's character but I'm getting the error "Argument 1 missing or nil"
This is the code that I'm using:
local text = script.Parent.Text local Players = game:GetService("Players") local function update(id) local userId = tonumber(id) local thumbType = Enum.ThumbnailType.AvatarThumbnail local thumbSize = Enum.ThumbnailSize.Size420x420 local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize) local imageLabel = script.Parent.Parent.avatar imageLabel.Image = content end script.Parent:GetPropertyChangedSignal("Text"):Connect(function() update(text) end)
Help would be appreciated :D
Hey there! Try this.
local Players = game:GetService("Players") local function Update(UserId) if Players:GetNameFromUserIdAsync(UserId) then local ThumbnailType = Enum.ThumbnailType.AvatarThumbnail local ThumbnailSize = Enum.ThumbnailSize.Size420x420 local Content = Players:GetUserThumbnailAsync( UserId, ThumbnailType, ThumbnailSize ) if Content then script.Parent.Parent:WaitForChild("avatar").Image = Content end end end script.Parent:GetPropertyChangedSignal("Text"):Connect(function() Update(script.Parent.Text) end)
G'day! :)