Cant get player avatar on image label

Here is the script :

local sc = script.Parent

sc.Touched:Connect(function(hit)
							
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	
	if player then
		
		local userID = player.UserId
		local thumType = Enum.ThumbnailType.AvatarBust
		local thumSize = Enum.ThumbnailSize.Size150x150
		local content = game.Players:GetNameFromUserIdAsync(userID, thumType, thumSize)
		
		game.Workspace.playersIcons.BillboardGui.Frame.ImageLabel.Image = content
		
	end
	
end)

Problem is:

Before touch
image

After touch

Question: How to make that player icon will show after part getting touched?

:GetNameFromUserIdAsync() is not the correct function. The correct function is: :GetUserThumbnailAsync()!

2 Likes

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