# MX-Dive
MX-Dive is a realistic diving system for RedM servers (RSG / VORP).
It replaces normal swimming with full control underwater: dive down, swim forward, look around, and ascend back to the surface. The character does not freeze, stays stable on the water line, and does not go through the river or lake floor.
---
## How to use
Enter the water and type `/dive` to turn the system on or off.
While dive is active:
- **Q** — dive down gradually
- **W** — swim forward
- **Space** — ascend to the surface
- Look around — the character turns with the camera
- **N** — switch to backstroke on the surface
- **G** — toggle fast swim
A key panel appears on the side of the screen while dive is active. If you leave the water, dive turns off automatically after a few seconds.
---
## Features
**Diving**
Smooth underwater movement with gradual descent and ascent. You can hold depth after releasing Q and keep swimming without sinking or popping back up every frame.
**Backstroke**
With dive enabled, press N to float on the surface with a backstroke animation. Press N again to return to dive mode. Can be disabled in the config.
**Fast swim**
Optional. With dive enabled, press G for extra speed toward the camera. Useful for crossing rivers and lakes faster. Can be fully disabled in the config (key and HUD entry included).
**Oxygen**
Optional. While underwater, oxygen drains over time. On the surface it regenerates. When oxygen reaches zero, the player starts taking damage until they come up to breathe. A small oxygen meter sits above the key panel and turns orange when low. Can be fully disabled in the config.
**Underwater camera**
When you go deep enough, a dedicated camera takes over for a cleaner underwater view. Can be disabled in the config.
**Key HUD**
A clean panel shows the available keys while diving. Optional features (fast swim, backstroke, oxygen) only appear when they are enabled.
**Multiplayer sync**
Nearby players see the correct dive and swim animations.
**Stamina**
By default, stamina stays full in the water so dive is not interrupted.
---
## Notes
- Default command: `/dive`
- Backstroke and fast swim only work with dive active and while in water
- W moves forward only — Q is used to descend
- Everything important can be adjusted in `config.lua`
---
Made by MX · Compatible with RSG and VORP · Requires ox_lib