I was wondering how you could get a specific tool to be able to destroy certain objects. I am making a d-day game, and was wondering how I could get the Bangalore to destroy the barbed wire, but no other explosives could do that. I am very new to scripting and am asking for some pointers and some help.
✓ ANSWER ACCEPTED
Certain weapon destroys certain objects?
1 answer
✓ Accepted answer
So, this might help you, basically what I've done was that I checked the object it touched.
--Insert this script into the object
while wait() do -- repeats the loop every time it waits a ccertain amount of time that roblox determines
script.Parent.Touched:Connect(function(hit) -- the object that it touched
if hit.Parent.Name == "barbed wire" then --Assuming that it is a model, if the parent of the object that it has touched has the name barbed wire or whatever you named it
hit.Parent:Destroy()
end
end)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thank you this will help me with my game, and help me learn more about scripting.
np