GetObjectModel
Jump to navigation
Jump to search
This function retrieves the model ID of a specified object
Syntax
Click to expand [+]
ServerExample
This example destroys a haystack when a player targets it
function onPlayerTargeted ( element )
if ( getElementType ( element ) == "object" ) and ( getObjectModel ( element ) == 3374 ) then
destroyElement ( element )
end
end
addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTargeted )
This example outputs the model id of objects the player is targetting.
function onPlayerTargeted ( element )
if ( getElementType ( element ) == "object") then
outputChatBox(getObjectModel ( element ))
end
end
addEventHandler ( "onPlayerTarget", getRootElement(), onPlayerTargeted )
See Also