Help setting imagebutton to image

I have a list of items in the player’s inventory and this function runs to set an imagebutton’s image the same as a tool in replicated storage. It wont set the image, and it prints them fine.
local itemlist = game.ReplicatedStorage.Items:GetChildren()
local items = {}
for i=1,#itemlist do
if itemlist[i].Name == itemName then
local itemimage = itemlist[i].TextureId
print(itemimage) – Prints the tool’s image just fine.
itemimage = label.Image – Doesnt do anything
print(label.Image) – Prints nothing
end
end
end
end

The problem you have here is that you were setting itemimage to label.Image, instead of setting label.Image to itemimage. Try setting label.image to itemimage and see if it works.

local itemlist = game.ReplicatedStorage.Items:GetChildren()
local items = {}
for i=1,#itemlist do
	if itemlist[i].Name == itemName then
		local itemimage = itemlist[i].TextureId
		print(itemimage)
		label.Image = itemimage
	print(label.Image) 
	end
end