``I made a trashcan where when you touch a part the items in your inventory gets removed but it doesn't seem like to work but I have no errors in the output so I don't why it's not working.
playa = game.Players.LocalPlayer backpacka = playa.Backpack script.Parent.Parent.Touched:connect(function(p) if backpacka then for _,v in ipairs(backpacka:GetChildren()) do if v:IsA('Tool') then v:Destroy() end end end end)
Sometimes ROBLOX has un-explainable problems that basically is just a problem with the engine. If there was no error in the output, I don't see whats wrong with it, I would have to test it in a game for me to work on it.
You need to actually assign a function, which you may think you did but you did not. Also there is no need to confuse yourself by assigning names like “backpacka”
function deletetools() for _,v in pairs(game.Players:GetPlayers()) do v.Backpack:ClearAllChildren() end end script.Parent.Parent.Touched:connect(deletetools)
And of course make this local, because I misunderstood the question and don’t feel like changing the answer.