createColSphere
Shared
Creates a spherical collision shape.
element|false createColSphere(float x, y, z, float radius)
Parameters
| Name | Type | Description |
|---|---|---|
| x, y, z | float | The sphere's centre. A vec3 also works. |
| radius | float | The 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)