Im trying to make a part that destroys certain models on touch, but it isn’t working.
Script I made:
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent.Name == "R6" then
local debris = game:GetService("Debris")
debris:AddItem(hit.Parent)
end
end)```
you’ve gotta add the lifetime number as the second variable:
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent.Name == "R6" then
local debris = game:GetService("Debris")
debris:AddItem(hit.Parent,1)
end
end)