bin = script.Parent
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
local player = game.Players:findFirstChild(h.Parent.Name)
local W = player.Backpack:children()
for i=1, #W do
if W~= nil then
W[i].Parent = nil
end
end
end
end
bin.Touched:connect(onTouched)
ok here what you had wrong:
you had BackPack not Backpack
use a findFirstChild(h.Parent.Name) in the players cases unless you will chage name of the model. other than that u did good |