Player.Backpack.ChildAdded not firing

Hello, so I’m making a custom hotbar.My issue is that my .ChildAdded event doesn’t work. It doesn’t fire when items are added. It only fires when i do: instance.new(). This is my script, please help

local Player = game.Players.LocalPlayer
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local Backpack = Player:WaitForChild("Backpack")
Backpack.ChildAdded:Connect(function(Weapon)
	print(Weapon)
end)

Any help is appreciated

ChildAdded() runs when there are new instances added to the backpack.

I think you’re spawning into the game and expecting everything in your backpack to print which is not the case as this event won’t fire.

2 Likes

Well i fixed it by doing it on the server and doing Player.DescendantAdded. And then checking if it’s parent is the backpack. Thx for the knowledge

2 Likes

In addition, you have to put .Name on Weapon when printing because the child added is just an instance. So if your printing it, it is just a instance then it won’t print any because it doesn’t know if you want to print the tip? The grip? And others

You can print instances, nil, numbers, strings anything. It was firing, but only if I did instance.new(“Tool”, Backpack).

1 Like