I am trying to make something so that if they touch a part they lose all their tools and their inventory clears almost like a safe zone. I have tried many things none of which have worked. Any help?
YOURPART.Touched:Connect(function(hit)
if hit.Parent:FindFirstChils("Humanoid") then
pcall(function()
local plr = game.Players[hit.Parent.Name]
for _,v in pairs(plr.Backpack:GetChildren()) do
v:Destroy()
end
end)
end
end)
if you want what the character is holding to be also removed then loop through the character too.
2 Likes