So I’m making an inventory system, but I ran into a small issue
local SS = game:GetService(“ServerStorage”)
local inventoryTemplate = SS:WaitForChild(“InventoryTemplate”)
local function Setupinv(player)
local inventory = player:WaitForChild("Inventory")
local pGUi = player:WaitForChild("PlayerGui")
local mainGUI = pGUi:WaitForChild("MainGUI")
local inventoryGUI = mainGUI:WaitForChild("invGUI")
print("b")
for i, item in pairs(inventory:GetChildren()) do
print("a")
local itemGUI = inventoryGUI.Template.Item:Clone()
itemGUI.Name = item.Name
itemGUI.ItemName.Text = item.Name
itemGUI.ItemQuantity.Text = item.Value
itemGUI.Parent = inventoryGUI.Itemlist
if item.Value >0 then
itemGUI.Visible = true
itemGUI.Parent = inventoryGUI.Itemlist
else
itemGUI.Visible = false
itemGUI.Parent = inventoryGUI.Itemlist
end
end
end
game.Players.PlayerAdded:Connect(function(player)
local gamedata = inventoryTemplate:Clone()
gamedata.Name = “Inventory”
gamedata.Parent = player
end)Preformatted text
this scripts for loop never runs. Any idea why?
For reference, heres what it looksl ike
Thanks!