I’m trying to make a script that loops through all the children looking for a tool and if there is a tool then delete it but the script only loops through everything else except the tool when the tool is inside the player.
cooldown = true
event = game.ReplicatedStorage.Events:WaitForChild("Delivered")
local crate
script.Parent.Touched:Connect(function(part)
if part.Name == "RightFoot" then
for _, item in pairs(part.Parent:GetChildren()) do
print(item.Name)
if item.Name == "Large Crate" then
item:Destroy()
print("aaaa")
end
if item.Name == "Small Crate" then
item:Destroy()
print("aaaa")
end
if item.Name == "Medium Crate" then
item:Destroy()
print("aaaa")
end
end
end
end)