Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Certain weapon destroys certain objects?

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.

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

2 comments

0

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

0

np

This discussion is preserved as it was. New answers, comments, and votes are closed.