Player Thumbnail Not Appearing in ImageLabel

What do you want to achieve?
A textbox that shows the player thumbnail when typed in.

What is the issue?
So it’s sending the thumbnail content to the ImageLabel’s image… The problem? It’s not appearing.

What solutions have you tried so far?
I have looked on the forum left and right rewrote the code, and even completely copied someone else’s code, and still it won’t appear. I have come here to ask for assistance now.

Here’s the code I wrote out.

--- Player Stuff ---
local Players = game:GetService("Players")
local PlayerValue = script.Parent.Parent.Parent.InfoStore.Player -- String value btw
--------------------

--- Image Stuff ---
local ImageLabel = script.Parent.Parent.PlayerLabel
local ImageSize = Enum.ThumbnailSize.Size420x420 -- Thumbnail Size
local ImageType = Enum.ThumbnailType.HeadShot -- Thumbnail Type
-------------------

--- Yep, thats the text box ---
local textBox = script.Parent
-------------------------------

local function focusLost(enterPressed)
	if enterPressed then
		script.Parent.Parent.Parent.InfoStore.Player.Value = textBox.Text
		
		if Players[PlayerValue.Value] then
			local Player = Players[PlayerValue.Value]

			local content = game.Players:GetUserThumbnailAsync(Player.UserId, ImageType, ImageSize) -- Gets Image from UserId

			script.Parent.Parent.PlayerLabel.Image = content -- Inserts Image
			
			print(Player.Name.." is loaded in the image")
			
		else
			
			warn("not a player")
			
		end	
		
	else
		
		script.Parent.Parent.Parent.InfoStore.Player.Value = textBox.Text
		
		if Players[PlayerValue.Value] then
			local Player = Players[PlayerValue.Value]
			
			local content = game.Players:GetUserThumbnailAsync(Player.UserId, ImageType, ImageSize) -- Gets Image from UserId

			script.Parent.Parent.PlayerLabel.Image = content -- Inserts Image
			
			print(Player.Name.." is loaded in the image")

		else
			
			warn("not a player")
			
		end	
	end
end

textBox.FocusLost:Connect(focusLost)

here’s some screenshots as well.

code1
So far so good

code2
Hmm? (The empty box is where the image is supposed to be btw)

code3
Ima assume this is happening because of IsLoaded but I’m not sure because it shouldn’t take this long to load it, I feel like I messed up on something (and yes, the image is visible)

Any help is appreciated, and thank you for your time.

Ah guys no need to reply, I believe this to be just on Roblox’s Studio’s part because I had another system that showed an image of the player and that’s not working now, but now works in-game.

Thanks for viewing this mess lol, I’m just overthinking it. If you do see something I could change in the code you are more than welcome to comment about it, and if you wanna copy it and use it for yourself, that’s also okay.

:slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.