Need help with using a UserID in script

can you give me a better picture of the error I cant read it, its too small.

image

can you show me the gui you have like on the explorer

image

recheck the code I wrote and try that I added some stuff to it to see if it would work

local Players = game:GetService("Players")
local Input = script.Parent.Input
local Output = script.Parent.Output
local ImageOutput = script.Parent.Headshot
Input.Changed:Connect(function()
	local Convert = Players:GetNameFromUserIdAsync(Input.Text)
	Output.Text = Convert
	ImageOutput.Image = Players:GetUserThumbnailAsync(tonumber(Convert), Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size420x420)
end)

image

are you sure the avatar shower code really works because I based that script off of the code snippet you gave to me.

Yes It works. I used it in another one of my games, also I think i know the problem, you aren’t mentioning the input box at all in the image part of your script

thats not it because the code you show’d me used userid so I replaced game.Players.LocalPlayer.UserId with the convert code I wrote to make it work with the textbox

ohhh… hmm, well I don’t know anything about the error i got.

alrighty I finally did it here you go

local Players = game:GetService("Players")
local Input = script.Parent.Input
local Output = script.Parent.Output
local ImageOutput = script.Parent.Headshot
Input.Changed:Connect(function()
	local Convert = Players:GetNameFromUserIdAsync(Input.Text)
	Output.Text = Convert
	ImageOutput.Image = Players:GetUserThumbnailAsync(tonumber(Input.Text), Enum.ThumbnailType.AvatarThumbnail, Enum.ThumbnailSize.Size420x420)
end)
1 Like

There’s a developer API page with all of this information: Players | Documentation - Roblox Creator Hub

1 Like