M MY Multiplayer: Wiki
Side
Kind

createColTube

Shared

Creates a collision shape shaped like an upright cylinder.

element|false createColTube(float x, y, z, float radius, float height)

Parameters

NameTypeDescription
x, y, zfloatThe centre of the cylinder's base. A vec3 also works.
radiusfloatThe radius in metres.
heightfloatThe height above the base, in metres.

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 tower = createColTube(1544.0, -1353.0, 13.0, 15, 320)

See also