Imagelabel not changing to player icon

  1. What do you want to achieve? Change imagelabel to player thumbnail icon.

  2. What is the issue? Image is blank and no errors appear.

  3. What solutions have you tried so far? Tried looking in devforum but found nothing.

--localscript
game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Killed").OnClientEvent:Connect(function(name, tix, icon)
	warn("I recevied it")
	tickets.Text = "You Killed: " ..name
	who.Text = "You earned: " ..tix
	what.Image = "rbxassetid://" ..icon
end)
--serverscript
local content = game.Players:GetUserThumbnailAsync(CharPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
killedevent:FireClient(LocalPlayer, CharPlayer.Name, 25, content)

The feedback is empty, therefore the image is empty.
Could the character that you killed be nil?

:GetUserThumbnailAsync() returns content as the URL with “rbxassetid://” already.

Change

what.Image = "rbxassetid://" ..icon

to

what.Image = icon

Obviously however you’re getting player for the server script replace that on line 3 or local player =… line.

This is a local script:

local Players = game:GetService("Players")

local player = Players.LocalPlayer

-- 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
script.Parent.Image = content

I take no credit for this script I used it for a different project and thought reposting it here will help you.

I am able to get the player dying from server, this is due to me being already able to get it’s name and everything expect for the icon.

So the code I sent you works for what you’ve requested then correct? :+1:

What i’m trying to do here is a simple “You killed” frame that gets the player who died from server using simple remote event parameters, then firing them to the player who killed client as a frame replacing textlabels with the player who died name and such…

local content = game.Players:GetUserThumbnailAsync(CharPlayer.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)

This should be done on the client (and not passed as an argument to FireClient). Better to consume the client’s bandwidth as opposed to the server’s bandwidth (where possible).