Alrighty so I’m working on an avatar editor. Each shirt is stored in a folder here:
It does not matter whether all Shirts
children are named the same or not, as I’ve tested changing their names aswell.
And each shirt folder has these children:
local ShirtTotal = 0
for i,v in pairs(game.ReplicatedStorage.Client.Shirts:GetChildren()) do
ShirtTotal = ShirtTotal + 1
imgbut = script.Parent.ShirtSelector.ImageButton:Clone()
imgbut.Parent = script.Parent.ShirtSelector
imgbut.Visible = true
imgbut.Name = "Shirt"..ShirtTotal
imgbut.Image = "rbxassetid://"..v.ShirtDisplayId.Value
imgbut.ShirtText.Value = "rbxassestid://"..v.TextureId.Value
imgbut.MouseButton1Click:Connect(function()
print(imgbut.Name)
game.Workspace.JoinDummy.Shirt.ShirtTemplate = imgbut.ShirtText.Value
end)
end
Things that work:
- Naming
-
ImageButton
image being set
Basically, the rest doesn’t work.
When I click imgbut
, I ALWAYS get the output of Shirt3
, as that is probably the most recent one cloned.
Setting the dummies shirt doesn’t work either.
Can I get some help with this? Thanks!