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.
So far so good
Hmm? (The empty box is where the image is supposed to be btw)
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.