Trouble will getting user thumbnail from username within a table

I’m attempting get retrieve the user thumbnail from the username that is in the table, output was “attempt to call a nil value”


		script.Parent:findFirstChild(number).Text = d[1]	-- works fine
		script.Parent:findFirstChild(number).ImageLabel.Image:GetUserThumbnailAsync(getUserIdFromUsername(d[1]), Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150) -- attempt to call a nil value... function (getUserIdFromUsername("anyname")) works
		
end

I think I’ve formatted the call wrong.

Your code should be:

script.Parent:findFirstChild(number).ImageLabel.Image = game:GetService("Players"):GetUserThumbnailAsync(getUserIdFromUsername(d[1]), Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)

What the script thinks you’re doing is that you’re trying to call the GetUserThumbnailAsync method on the imagelabel’s / button’s image, which is why the script says “attempt to call a nil value”. GetUserThumbnailAsync doesn’t exist