OnClientObjectBreak

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

<pageclass class="client" subcaption="Client-side event"></pageclass> <lowercasetitle></lowercasetitle> This event is fired before an object breaks.

[[{{{image}}}|link=|]] Note: This event is only triggered for objects that are streamed in

Parameters

element attacker
  • attacker: the vehicle/ped/player who is breaking the object

Source

The source of this event is the object which will break.

Cancel effect

If this event is canceled, the object will not break.

Example

<section class="client" name="Client" show="true"> This example prevents objects from beeing broken in interiors.
addEventHandler("onClientObjectBreak", root,
    function()
        if getElementInterior(source) ~= 0 then
            cancelEvent()
        end
    end
)

</section>

See Also

Client object events

Client event functions