How would i make it so that if there is two of the same things in an inventory then the textlabel that i have in the textbutton would say how much of the same things there are?
Remotes.AddToInventory.OnClientEvent:Connect(function(name, info)
local haha = {name, info}
table.insert(InventoryTable.Inventory, haha)
end)
InventoryButton.MouseButton1Click:Connect(function()
InventoryFrame.Visible = not InventoryFrame.Visible
if InventoryFrame.Visible == true then
for i,v in InventoryFrame:GetChildren() do
if v:IsA("TextButton") then
v:Destroy()
end
end
local items = {}
for i,v in InventoryTable.Inventory do
local TextButton = script.TextButton:Clone()
TextButton.Parent = InventoryFrame
TextButton.Name = v[1]
TextButton.Text = v[1]
end
end
end)