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

How do I execute a script on explosion?

I am wondering if it is even possible to make a script inside of a part start when the part explodes. By "explodes," I mean it being affected by the blast radius of the "Explosion" object. For example, when someone shoots a rocket launcher at a brick, a script in the brick is enabled, and the script does something like changing color. I don't think there is a way to do this, but if there is I would like to know what it is.

2 comments

1

By part exploding do you mean being affected by the blast radius of an explosion object or something else?

0

I mean affected by the blast radius of an explosion object.

1 answer

You're in luck! There is actually an event that does just what you're looking for. The Hit event of an explosion object returns both if a part was hit by an explosion and how far it was moved.

You can find documentation and a really good example on this wiki page found here.

2 comments

0

Thanks!

0

No problem :)

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