engineReplaceCOL | Multi Theft Auto: Wiki Skip to content

engineReplaceCOL

Client-side
Server-side
Shared

Pair: engineRestoreCOL

This function replaces the collision file of the given model id to the collision file passed. Use engineLoadCOL to load the collision file first.

Note
  • Follow loading order ( COL -> TXD -> DFF ) as other orders can cause collisions, textures or the DFF not to load.
  • Object models are supported only (no vehicles or peds).

OOP Syntax Help! I don't understand this!

  • Method:col:replace(...)

Syntax

bool engineReplaceCOL ( ​col theCol, ​int modelID )
Required Arguments
  • theCol: The collision file to replace with.
  • modelID: The model ID whose collision file you want to replace.

Returns

  • bool: result

Returns true if the collision was successfully replaced, false or nil if the collision could not be replaced for a reason.

Code Examples

client
local col = engineLoadCOL("trashcan.col")
engineReplaceCOL(col, 1337)

See Also

Engine Functions