# isElementInWater (Client)

> Tells whether a ped, player or vehicle is in the water.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Elements
- **URL**: https://wiki.mymp.gg/en/isElementInWater

## Syntax

```lua
bool isElementInWater(element element)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The ped, player or vehicle. |

## Returns

`true` if it is in the water, `false` if not or if the element is not a ped, player or vehicle.

A ped inside a vehicle is in the water when its vehicle is.

## Example

```lua
addEventHandler("onClientRender", root, function()
    if isElementInWater(localPlayer) then
        dxDrawText("You are in the water", 20, 20)
    end
end)
```

## See also

- [isElementOnFire (Shared)](https://wiki.mymp.gg/en/isElementOnFire.md): Tells whether an element is on fire.
- [getElementPosition (Shared)](https://wiki.mymp.gg/en/getElementPosition.md): Reads an element's position in the world.
