# createColCuboid (Shared)

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

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Collision shapes
- **URL**: https://wiki.mymp.gg/en/createColCuboid

## Syntax

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

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `x, y, z` | `float` | The box's corner with the lowest `x`, `y` and `z`. A `vec3` also works. |
| `width, depth, height` | `float` | The 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

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

## See also

- [createColRectangle (Shared)](https://wiki.mymp.gg/en/createColRectangle.md): Creates a rectangular collision shape, aligned with the world's axes and with no height limit.
- [createColSphere (Shared)](https://wiki.mymp.gg/en/createColSphere.md): Creates a spherical collision shape.
- [onColShapeHit (Server)](https://wiki.mymp.gg/en/onColShapeHit.md): Fired when a player, ped, vehicle or object enters a collision shape.
