my code:
local Inv = game.StarterGui.Inventory.Frame1.ScrollingFrame
game.Players.PlayerAdded:Connect(function(Player)
local inventory = Instance.new("Folder",Player)
inventory.Name = "Inventory"
inventory.ChildAdded:Connect(function(Item)
print("ITEM ADDED TO INVENTORY")
print("Item Added To Inventory")
Item = Instance.new("ImageButton")
Item.Parent = Inv
Item.Visible = true
Item.Size = UDim2.new(1,0,1,0)
Item.Image = "http://www.roblox.com/asset/?id=(NUMBER)"
if Item.Name == "standardSword" then
Item.Image = "http://www.roblox.com/asset/?id=(umber)"
elseif Item.Name == "neonSword" then
Item.Image = "http://www.roblox.com/asset/?id=(number)"
elseif Item.Name == "woodSword" then
Item.Image = "http://www.roblox.com/asset/?id=(number)"
end
end)
end)

3 comments
im checking if an item is being added to the players inventory
Also did you add an instance to the inventory folder? Because it won't work if you didn't
I misunderstood it, I thought you're trying to check if the instance inventory has been added