setObjectBreakable | Multi Theft Auto: Wiki Skip to content

setObjectBreakable

Client-side
Server-side
Shared

Pair: isObjectBreakable

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function sets an object to be breakable/unbreakable.

Syntax

setObjectBreakable ( )

Code Examples

server

This example creates an object when the resource starts and sets it to be breakable.

function toggleObjectVulnerability()
local object = createObject(1337, 5540.6654, 1020.55122, 1240.545)
if isObjectBreakable(object) then
setObjectBreakable(object, false)
outputChatBox("The object is now not breakable.")
else
setObjectBreakable(object, true)
outputChatBox("The object is now breakable.")
end
end
addEventHandler("onClientResourceStart", resourceRoot, toggleObjectVulnerability)