OnMarkerHit: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 17: | Line 17: | ||
==Example== | ==Example== | ||
<!-- Explain what the example is in a single sentance --> | <!-- Explain what the example is in a single sentance --> | ||
This | This will output 'hi' in the chatbox when the marker is hit. | ||
<!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --> | <!-- Add the code below, an emphasis should be on making it clear, not optimized. You could provide two versions if you wish, one clear and well commented, the other optimized --> | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function MarkerHit ( hitPlayer, matchingDimension ) | |||
outputChatBox ( "hi" ) | |||
end | |||
addEventHandler("onMarkerHit", root, MarkerHit)</syntaxhighlight> | |||
</syntaxhighlight> | |||
{{See also/Server event|Marker events}} | {{See also/Server event|Marker events}} | ||
Revision as of 02:44, 14 January 2008
This article needs checking. | |
Reason(s): Appears to be broken, use ColShapes instead--Mabako 11:59, 12 January 2008 (CST) |
This event is triggered when a player enters a marker created using createMarker.
Parameters
player hitPlayer, bool matchingDimension
- hitPlayer: The player that hit the marker
- matchingDimension: True if the player is in the same dimension as the marker he hit
Source
The source of this event is the marker that got hit by the player.
Example
This will output 'hi' in the chatbox when the marker is hit.
function MarkerHit ( hitPlayer, matchingDimension ) outputChatBox ( "hi" ) end addEventHandler("onMarkerHit", root, MarkerHit)
See Also
Marker events
Event functions
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled