# RM Revive System
A comprehensive revive system for FiveM servers with configurable options and admin commands.
## Features
-
**Self-Revive**: Players can revive themselves after a configurable timer
-
**Admin Revive**: Admins can revive other players with a command
-
**Temporary Invincibility**: Players become invincible and transparent after reviving
-
**Bucket Restrictions**: Configurable routing bucket restrictions for revive permissions
-
**Export Functions**: Other scripts can interact with the revive system
## Installation
1. Download the script files
2. Place in your `resources` folder
3. Add `start rm_revive` to your `server.cfg`
4. Configure the settings in `config.lua`
## Dependencies
- [ox_lib](https://github.com/overextended/ox_lib) - For notifications
## Configuration
Edit `config.lua` to customize the script:
### Basic Settings
```lua
reviveTimer = 2, -- Seconds to wait before self-revive
alphaDuration = 7, -- Seconds of invincibility after revive
alphaValue = 102, -- Transparency level (0-255)
```
### Feature Toggles
```lua
enableSelfRevive = true, -- Allow self-reviving
enableAdminRevive = true, -- Allow admin revive command
enableInvincibility = true, -- Enable post-revive invincibility
enableTransparency = true, -- Enable transparency effect
enableBucketCheck = true, -- Check routing buckets
```
### Bucket Settings
```lua
minBucket = 0, -- Minimum bucket for revive (usually 0)
maxBucket = 90000, -- Maximum bucket for revive
```
### Commands
```lua
reviveCommand = "rv", -- Admin command name
requireAcePermission = true, -- Require ACE permission
```
### Debug
```lua
debugMode = false, -- Enable debug logging
```
## Usage
### For Players
When dead, press **E** to revive after the timer expires.
### For Admins
Use `/rv [playerId]` to revive another player.
## Export Functions
Other scripts can use these exports:
```lua
-- Revive a player
exports['rm_revive']:revivePlayer(playerId)
-- Check if player is dead (client-side only)
local isDead = exports['rm_revive']:isPlayerDead(playerId)
```
## Events
### Client Events
- `RMRevive:revivePlayer` - Revive a player
- `RMRevive:ApplyAlphaClient` - Apply transparency effect
### Server Events
- `RMRevive:ApplyAlphaToAll` - Trigger transparency for all players
- `RMRevive:get_bucket` - Get player's routing bucket
## Notifications
All notification messages are configurable in the `notifications` table.
## Troubleshooting
1. **Players can't revive**: Check bucket settings and permissions
2. **Transparency not working**: Ensure `enableTransparency = true`
3. **Command not working**: Check ACE permissions
4. **Debug mode**: Set `debugMode = true` for console logging