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

How do I correctly use the Hit function?

Asked by 10 years ago

I now know that I could use the Hit function to execute a script when the part is hit by an explosion. I just don't know how to do that. I was wondering if I could get more help on this issue. I would love for you guys to help! Thanks!

2 answers

Log in to vote
0
Answered by 10 years ago

Make a part at the explosions position Then, see what it touches. You can use an onTouched() script and it will still work perfectly.

0
I'm not sure I understand. Lightdrago 95 — 10y
0
Ok, so, How are you making the explosion? Make a part at the same place as the explosion. unix_system 55 — 10y
Ad
Log in to vote
0
Answered by
iLegitus 130
10 years ago

Best is like this : (Put this inside a part)(Script)

script.Parent.Touched:connect(function(hit)
wait(0.03)
--- STUFF 
end)
0
Thanks! Lightdrago 95 — 10y
0
Anytime. iLegitus 130 — 10y
0
I just realized: that just makes it where when I touch it, it also does the "STUFF," not just when it explodes. Lightdrago 95 — 10y

Answer this question