Instead of the single object (Accessory) being cloned inside the character in workspace its the whole folder gets cloned into the character.INFO the actual folder the model is being cloned from is saved in the player in a folder called 'HelmetStorage' saved in the players storage folder, why?
player = game.Players.LocalPlayer -- local Enabled = false function UpdateInventory() if Enabled == false then Enabled = true script.Parent.ScrollingFrame.Visible = true script.Parent.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,20*#player.Inventory.HelmetStorage:children()) script.Parent.ScrollingFrame:ClearAllChildren() for i,v in pairs(player.Inventory.HelmetStorage:GetChildren()) do local Place = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Inventory.HelmetStorage local Obj1 = Instance.new('TextButton',script.Parent.ScrollingFrame) Obj1.Size = UDim2.new(1,-12,0,20) Obj1.Position = UDim2.new(0,0,0,20*i-20) Obj1.BackgroundTransparency = 0 Obj1.FontSize = 'Size24' Obj1.Text = v.Name Obj1.Font = 'Cartoon' Obj1.ZIndex = 7 Obj1.TextColor3 = Color3.new(255, 255, 255) Obj1.TextXAlignment = 'Left' Obj1.MouseButton1Down:connect(function() player.Inventory.HelmetStorage:Clone(v).Parent = player.Character warn("PRESSEDD") end) end else Enabled = false end end script.Parent.Parent.Parent.Parent.BottomFrame1.CHARACTER.Button.MouseButton1Down:connect(function() UpdateInventory() end) player.Inventory.HelmetStorage.Changed:connect(function() if Enabled == false then Enabled = true UpdateInventory() end if Enabled == true then Enabled = false UpdateInventory() end end)
I think the problem is this line
player.Inventory.HelmetStorage:Clone(v).Parent = player.Character warn("PRESSEDD")
Yeah, the problem is that line.
player.Inventory.HelmetStorage:Clone(v).Parent = player.Character
"HelmetStorage:Clone()" is the whole storage being cloned. Putting v
in the function Clone() does nothing.
Since you're already using a For loop and iterating through all the items, the helmet you want is v
for i,v in pairs(player.Inventory.HelmetStorage:GetChildren()) do local helmetClone = v:Clone() helmetClone.Parent = player.Character end
I think im close but it says its not a valid member ect UGHH
player = game.Players.LocalPlayer -- local Enabled = false function UpdateInventory() if Enabled == false then Enabled = true script.Parent.ScrollingFrame.Visible = true script.Parent.ScrollingFrame.CanvasSize = UDim2.new(0,0,0,20*#player.Inventory.HelmetStorage:children()) script.Parent.ScrollingFrame:ClearAllChildren() for i,v in pairs(player.Inventory.HelmetStorage:GetChildren()) do warn("GOT CHILDREN") local Client = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent local Place = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Inventory.HelmetStorage local Obj1 = Instance.new('TextButton',script.Parent.ScrollingFrame) warn(Client.Name) Obj1.Size = UDim2.new(1,-12,0,20) Obj1.Position = UDim2.new(0,0,0,20*i-20) Obj1.BackgroundTransparency = 0 Obj1.FontSize = 'Size24' Obj1.Text = v.Name Obj1.Font = 'Cartoon' Obj1.ZIndex = 6 Obj1.TextColor3 = Color3.new(255, 255, 255) Obj1.TextXAlignment = 'Left' Obj1.MouseButton1Down:connect(function() Client.Inventory.HelmetStorage(v.Name):Clone().Parent = player.Character warn("CLONED") end) end else Enabled = false end end script.Parent.Parent.Parent.Parent.BottomFrame1.CHARACTER.Button.MouseButton1Down:connect(function() UpdateInventory() end) player.Inventory.HelmetStorage.Changed:connect(function() if Enabled == false then Enabled = true UpdateInventory() end if Enabled == true then Enabled = false UpdateInventory() end end)