OnPlayerContact: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server event}} | {{Server event}} | ||
This event is triggered when a player stands on | This event is triggered when a player stands on a differnt element than before. | ||
==Parameters== | ==Parameters== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
element | element previousElement, element currentElement | ||
</syntaxhighlight> | </syntaxhighlight> | ||
*''' | *'''previousElement''': The [[element]] player was standing on before. ''nil'' if none. | ||
*''' | *'''currentElement''': The new [[element]] that the player is standing on now. ''nil'' if none. | ||
==Source== | ==Source== |
Revision as of 05:48, 30 December 2007
This event is triggered when a player stands on a differnt element than before.
Parameters
element previousElement, element currentElement
- previousElement: The element player was standing on before. nil if none.
- currentElement: The new element that the player is standing on now. nil if none.
Source
The source of this event is the player who hit an element.
Example
This example outputs the element type of an element you have hit
function outputElementType ( prev, current ) if ( current ) then outputChatBox ( "You have hit an "..getElementType ( current ) ) end end addEventHandler ( "onPlayerContact", getRootElement(), outputElementType )
See Also
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled