Part detect explosion

Hi, I’m a beginner scripter in roblox. I was making a rocket launcher and wanted the engines to explode when it got hit by a explosion. I tried hit.ClassName but it wont detect explosion like the normal object.Help me please.

What engines are you referring to?

Helicopter engines and other vehicles engines

Use the Explosion.Hit event and then use the parameter the connected function gives you which will be a BasePart and unanchore them.

I don’t know how to register the Explosion.Hit event on my gun engine (warbound).

I think u can put IntValue to engine you referring, set value and then when engines got hit by rocket launcer, u need decrase value of intvalue, and then when int.Value == 0 then, u can add explode things.

Explosion instances have a Hit RBXScriptSignal object (event) which is fired whenever the explosion comes into contact with BasePart instances, here’s a short example.

task.wait(5)

local explosion = Instance.new("Explosion")
explosion.Hit:Connect(function(part, distance)
	print(part.Name.." was hit "..distance.." studs away from the explosion.")
end)
explosion.Parent = script.Parent

Output:
image

Relevant documentation articles:
https://developer.roblox.com/en-us/api-reference/class/Explosion
https://developer.roblox.com/en-us/api-reference/event/Explosion/Hit

1 Like