OnClientElementModelChange: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client event}} This event is triggered when the model of an element is changed using setElementModel. ==Parameters== <syntaxhighlight lang="lua"> int oldM...") |
Dutchman101 (talk | contribs) m (Reverted edits by Dutchman101 (talk) to last revision by Myonlake) Tag: Rollback |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Client event}} | {{Client event}} | ||
This event is triggered when the model of an [[element]] is changed using [[setElementModel]]. | {{New feature/item|3.0157|1.5.6|16404|This event is triggered when the model of an [[element]] is changed using [[setElementModel]].}} | ||
==Parameters== | ==Parameters== |
Latest revision as of 16:46, 19 June 2021
This event is triggered when the model of an element is changed using setElementModel.
Parameters
int oldModel, int newModel
- oldModel: an int representing the model of the element before the change occurred.
- newModel: an int representing the new model of the element.
Source
The source of this event is the element that changed its model.
Cancel effect
This event doesn't support cancellation. Use setElementModel with the old value to reverse.
Example
This example sends a message to players when their model changes telling them what the model ID is and was.
function informPlayerOnModelChange(oldModel, newModel) if ( getElementType(source) == "player" ) then -- Make sure the element is a player outputChatBox("Model ID changing from: "..oldModel.." to: ".. newModel, 0, 255, 0) -- Message for player end end addEventHandler("onClientElementModelChange", root, informPlayerOnModelChange) -- Bind the event to every element
See Also
Client element events
- onClientElementColShapeHit
- onClientElementColShapeLeave
- onClientElementDataChange
- onClientElementDestroy
- onClientElementDimensionChange
- onClientElementInteriorChange
- onClientElementModelChange
- onClientElementStreamIn
- onClientElementStreamOut
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled