# isPedOnGround (Shared)

> Tells whether a ped or player is on the ground.

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

## Syntax

```lua
bool isPedOnGround(ped ped [, bool checkVehicles = false])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |
| `checkVehicles` | `bool` | `true` to also count the ped standing on another entity, such as a vehicle. Only has an effect on the client. *(default: `false`)* |

## Returns

`true` if it is on the ground, `false` if not or if there is no state to read.

On the client, the ped is on the ground when it is at most 1 metre above the ground beneath it. On the server, the last state the client synced is used: the ped is on the ground when it is not in the air, swimming or on a ladder.

## Example

```lua
bindKey("space", "down", function()
    if not isPedOnGround(localPlayer, true) then
        print("Already in the air")
    end
end)
```

## See also

- [isPedInWater (Shared)](https://wiki.mymp.gg/en/isPedInWater.md): Tells whether a ped or player is in the water.
- [isPedDucked (Shared)](https://wiki.mymp.gg/en/isPedDucked.md): Tells whether a ped or player is crouching.
- [getPedContactElement (Client)](https://wiki.mymp.gg/en/getPedContactElement.md): Returns the vehicle or object a ped is standing on.
- [getPedMoveState (Client)](https://wiki.mymp.gg/en/getPedMoveState.md): Tells how a ped on foot is moving.
