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)
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.
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);