Code:

script.Parent.Touched:Connect(function(hit)

if hit:IsA("Part") then hit:Destroy() end

end)

Idk what's happening but for some reason this line of code won't destroy everything that it touches.

script.Parent.Touched:Connect(function(hit)

hit:Destroy()

end)

I've already tried it with this and the results were the same. It can only detect Player touches

10 comments

0

Where is the script located? Inside a part? Inside the Player?

0

my guy it's in the part

0

Have you tried checking the classname

0

Isn't that the same as the first piece of code i mentioned using?

0

:IsA checks for the classname. Doing :IsA() and Instance.ClassName is both the same thing (from my knowledge)

0

You can't use Touched to detect if parts are touching. If your parts have CanCollide on, you can use :GetTouchingParts(), but if not you'll have to use a more complicated method to detect this.

0

wait let me try that

0

Could you explain this method please?

0

is your script local?

0

Nope