Hit (Event): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
>Mr Doom Bringer No edit summary |
>Tenal No edit summary |
||
(13 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Event| | {| | ||
name = Hit | |<onlyinclude>{{Event|name = Hit | ||
|arguments = [[Instance]] part, [[ | |arguments = [[Instance]] part, [[Number]] distance | ||
|description = Fired when an object hits another one. | |description = Fired when an object hits another one. | ||
|object = | |object = Explosion | ||
|}} | |}}</onlyinclude> | ||
|} | |||
== Description == | |||
The Hit event for explosions fires off whenever the explosion comes in contact with another brick. Can be useful for triggering bricks to disappear after being blown up, or anything else for items hit by the explosion. | |||
{{Example|<pre> | |||
game.Workspace.Explosion.Hit:connect(function(p, d) | |||
print("Hit ", p, " from", d, " studs.") | |||
end) | |||
</pre>}} | |||
[[Category:Events]] |
Latest revision as of 03:31, 7 February 2012
Description
The Hit event for explosions fires off whenever the explosion comes in contact with another brick. Can be useful for triggering bricks to disappear after being blown up, or anything else for items hit by the explosion.
Example
game.Workspace.Explosion.Hit:connect(function(p, d) print("Hit ", p, " from", d, " studs.") end)