Best way to change inventory images?

  1. What do you want to achieve? Keep it simple and clear!
    I want to know the best way to make the images for image labels the same as the decal textures within a folder. 1 image label image should be the decal texture in the Classic sword and another image label the same as the decal in the Grenade.

The beginning of what I’ve tried.

script.Parent.MouseButton1Click:Connect(function()
for i, v in pairs(player.Inventory:GetChildren()) do --Inventory is the folder full of tools with decals inside them

end
end)

image
The decals in the tools.

image
The image labels.

You’re going to need to provide a lot more information. This isn’t a sufficient explanation by any means.

1 Like

Sorry, accidentally posted before finishing.

local Slots = {};
for i, v in pairs(invFrame:GetChildren())
   if not v:IsA("ImageLabel") then continue end;
   Slots[#Slots + 1] = v;
end;
script.Parent.MouseButton1Click:Connect(function()
   for i, v in pairs(player.Inventory:GetChildren()) do
      Slots[i].Image = v.invIMG.Texture;
   end;
end);

This should work, it just maps slots into an array, and puts the inventory items back into that inventory using the ImageLabel’s .Image property and the Decal’s .Texture property.

1 Like

Thanks a lot, been stuck doing this for a while cuz I’m a banana.

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.invFrame.Visible = true
	local Slots = {};
	for i, v in pairs(script.Parent.Parent.invFrame:GetChildren()) do
		if not v:IsA("ImageLabel") then continue end;
		Slots[#Slots + 1] = v;
end;

	for i, v in pairs(player.Inventory:GetChildren()) do
		Slots[i].Image = v.invIMG.Texture;
	end;
end);