# setColPolygonHeight (Shared)

> Limits between which heights a collision polygon detects elements.

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

## Syntax

```lua
bool setColPolygonHeight(element shape, float|bool floor, float|bool ceiling)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `shape` | `element` | A collision shape made by `createColPolygon`. |
| `floor` | `float\|bool` | The lowest height, or a boolean for no floor. |
| `ceiling` | `float\|bool` | The highest height, or a boolean for no ceiling. |

## Returns

`true` once the heights are set.

If the floor is above the ceiling, the two are swapped. On the server, the change reaches the clients.

## Example

```lua
setColPolygonHeight(lot, 10, false) -- from 10 m up, with no ceiling
```

## See also

- [getColPolygonHeight (Shared)](https://wiki.mymp.gg/en/getColPolygonHeight.md): Returns between which heights a collision polygon detects elements.
- [createColPolygon (Shared)](https://wiki.mymp.gg/en/createColPolygon.md): Creates a collision shape shaped like a flat polygon, with no height limit until setColPolygonHeight gives it one.
