onClientObjectBreak | Multi Theft Auto: Wiki Skip to content

onClientObjectBreak

Client-side
Server-side
Shared

This event is fired before an object breaks.

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

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

Canceling

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

Code Examples

client

This example prevents objects from beeing broken in interiors.

addEventHandler("onClientObjectBreak", root,
function()
if getElementInterior(source) ~= 0 then
cancelEvent()
end
end
)