GetUserThumbnailAsync does not properly set OTHER player's avatar image

I have a local script which loops through the players and if there’s not already a player found in a frame then it adds the player or other players.

game.ReplicatedStorage:WaitForChild('Remotes').EnableGameUI.OnClientEvent:Connect(function(player)
	local playerData = ServerFunction:InvokeServer("getData")

	setNPCHUDName:FireServer(player)
	local userId = player.UserId
	local thumbType = Enum.ThumbnailType.HeadShot
	local thumbSize = Enum.ThumbnailSize.Size420x420
	local content, isReady = Players:GetUserThumbnailAsync(userId, thumbType, thumbSize)
	
	for alpha,bravo in pairs(game.Players:GetChildren()) do
		if not mainGameGUI.GameHUD.Players:FindFirstChild(bravo.Name) then

			local newPlayer = script.PlayerTop:Clone()
			newPlayer.Parent = script.Parent:WaitForChild('GameHUD').Players
			newPlayer.ImageLabel.Image = (isReady and content)
			newPlayer.Name = bravo.Name
		end
	end
end)

The problem is this is not correct, the second image should be of the OTHER player:

You’re only fetching the thumbnail for whichever player is fired to the EnableGameUI remote (assuming there’s two arguments fired from the server) so the thumbnail only resolves once. If you want to grab each player’s thumbnail then you should also be making the thumbnail call while iterating through the existing players.

1 Like

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