Hello! So I have this script where when a tool is tossed on a part, the part gets destroyed, now I want to add onto it where when the part gets destroyed WITH the tool, so they have to go get another tool in order to break all the parts. Here is the script to add onto:
script.Parent.Touched:Connect(function(p) if p.Parent.Name == "WhiteBall" then script.Parent:Destroy() end end)
If you cannot tell I am not experienced with scripting, so help is needed. Thank you!
One action:
p.Parent:Destroy()
Obviously you should destroy the p.Parent first so that the script continues to run. Self destruct always comes last.
script.Parent.Touched:Connect(function(p) if p.Parent.Name == "WhiteBall" then script.Parent:Destroy() end end)
In the code up there, I put p.Parent because if I didn't it would see the hit part as "Handle" Also, the code up there is the script for the part that gets hit by the ball.
script.Parent.Touched:Connect(function(p) if p.Name == "Insert the part name here" then script.Parent:Destroy() end end)
In the code up there, this has to be inserted inside the tool, also you should name the part that's gonna get destroyed with the tool that's different than all the other parts name. I'm telling you to do this because if there were 10 parts that were named the same and the code above was looking for a part named that, all of them can be destroyed by the ball.