Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How do I execute a script on explosion?

Asked by 9 years ago

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.

1
By part exploding do you mean being affected by the blast radius of an explosion object or something else? BlackJPI 2658 — 9y
0
I mean affected by the blast radius of an explosion object. Lightdrago 95 — 9y

1 answer

Log in to vote
1
Answered by
BlackJPI 2658 Snack Break Moderation Voter Community Moderator
9 years ago

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.

0
Thanks! Lightdrago 95 — 9y
0
No problem :) BlackJPI 2658 — 9y
Ad

Answer this question