Hit (Event): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Camoy
Small fix
>Camoy
Example/heading added
Line 1: Line 1:
{|
{|
|<onlyinclude>{{Event|
|<onlyinclude>{{Event|name = Hit
name = Hit
|arguments = [[Instance]] part, [[Number]] distance
|arguments = [[Instance]] part, [[Number]] distance
|description = Fired when an object hits another one.
|description = Fired when an object hits another one.
Line 7: Line 6:
|}}</onlyinclude>
|}}</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.
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>}}

Revision as of 14:51, 29 August 2010

Hit ( Instance part, Number distance )
Description Fired when an object hits another one.
Member of: [[RBX.lua.Explosion (Object)|Explosion]]

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)