Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

? script not detecting child being added to folder

Asked by 2 years ago

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)
0
im checking if an item is being added to the players inventory Zythicaal 2 — 2y
0
Also did you add an instance to the inventory folder? Because it won't work if you didn't xXLegendGamerz16Xx 231 — 2y
0
I misunderstood it, I thought you're trying to check if the instance inventory has been added xXLegendGamerz16Xx 231 — 2y

Answer this question