M MY Multiplayer: Wiki
Side
Kind

createColSphere

Shared

Creates a spherical collision shape.

element|false createColSphere(float x, y, z, float radius)

Parameters

NameTypeDescription
x, y, zfloatThe sphere's centre. A vec3 also works.
radiusfloatThe radius 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 pickup = createColSphere(2488.0, -1666.0, 13.3, 1.5)

See also