# onElementColShapeLeave (Server)

> Fired on a player, ped, vehicle or object when it leaves a collision shape.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Event
- **Side**: Server
- **Category**: Collision shapes
- **URL**: https://wiki.mymp.gg/en/onElementColShapeLeave

## Syntax

```lua
addEventHandler("onElementColShapeLeave", root, function(element colShape, bool matchingDimension) ... end)
```

## Handler parameters

| Name | Type | Description |
| --- | --- | --- |
| `colShape` | `element` | The collision shape it left. |
| `matchingDimension` | `bool` | Whether the element is in the same dimension as the shape. |

## Source

The element that left.

It fires right after `onColShapeLeave`, unless a handler of that one destroyed the element.

## Example

```lua
addEventHandler("onElementColShapeLeave", root, function(colShape)
    if colShape == safeZone and getElementType(source) == "vehicle" then
        setElementFrozen(source, false)
    end
end)
```

## See also

- [onElementColShapeHit (Server)](https://wiki.mymp.gg/en/onElementColShapeHit.md): Fired on a player, ped, vehicle or object when it enters a collision shape.
- [onColShapeLeave (Server)](https://wiki.mymp.gg/en/onColShapeLeave.md): Fired when a player, ped, vehicle or object leaves a collision shape.
