Automatic Update Headshot

Hello im trying to make a system where it puts a Players headshot on the wall and every time there avatar changes it will update but for some reason its not putting the image on the decal and it just stays blank. can someone please help me fix this

this system runs off serverside script so i dont know if anything is wrong with that…

local Players = game:GetService("Players")
local userId = script.Parent.UserId.Value

while true do
	local thumbnail, isReady = Players:GetUserThumbnailAsync(userId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)

	if isReady and thumbnail ~= "" then
		print("Thumbnail URL: ", thumbnail)
		if script.Parent:FindFirstChild("PhotoFrame") and script.Parent.PhotoFrame:FindFirstChild("Photo") and script.Parent.PhotoFrame.Photo:FindFirstChild("Decal") then
			script.Parent.PhotoFrame.Photo.Decal.Texture = thumbnail
			print("Decal updated with thumbnail.")
		else
			warn("Decal path is incorrect!")
		end
	else
		warn("Thumbnail not ready or failed to load!")
	end

	wait(5)
end

1 Like

Question :

  • How did you update the UserId.Value?
  • Where did you place the script?
  • Why do you want to loop it?
  • Before you decided to add the loop, did it work fine?

i found out that the userid value was not updating thanks for the help

i deleted the value and put it into the script.

1 Like

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