M MY Multiplayer: Wiki
Side
Kind

createColCuboid

Shared

Creates a box-shaped collision shape, aligned with the world's axes.

element|false createColCuboid(float x, y, z, float width, depth, height)

Parameters

NameTypeDescription
x, y, zfloatThe box's corner with the lowest x, y and z. A vec3 also works.
width, depth, heightfloatThe box's size along x, y and z, in metres. Negative values count as 0. A vec3 also works.

Returns

The created colshape element, or false if it could not be created.

A collision shape detects players, peds, vehicles and objects by their position and fires onColShapeHit and onColShapeLeave (onClientColShapeHit and onClientColShapeLeave on a client). It goes away when the resource that created it stops.

Example

local garage = createColCuboid(2495.0, -1690.0, 12.5, 8, 6, 4)

See also