Flake Bodybag
A professional bodybag, burial, and character-kill system for FiveM. Supports ESX, QBX, and QB-Core with ox_target, qb-target, or TextUI interaction modes.
Overview
Flake Bodybag is a comprehensive death-handling system designed for serious roleplay servers. It allows players and admins to bag deceased characters, place them in coffins, bury them at designated sites, or dump them into the ocean — with full character-kill (CK) backup and restoration support.
What It Does
- Bodybagging — Place dead players into a physical bodybag prop with progress-bar animations.
- Coffin Placement — Transfer a bodybagged player into a weighted coffin prop for transport.
- Burial — Bury bodybagged players at configured cemetery locations with shovel animations.
- Ocean Dumping — Push coffins into the water at pier locations for permanent disposal.
- Character Kill (CK) — Admins can permanently kill a character with full database backup.
- UnCK Restoration — Restore previously CKed characters from backup with one command.
- Gulag Integration — Optional compatibility with Flake Gulag for alternative sentencing.
Requirements
| Dependency | Purpose | Required |
|---|---|---|
oxmysql | Database operations and CK backups | Yes |
ox_lib | Progress bars, callbacks, menus, TextUI | Yes |
| ESX / QBX / QB-Core | Framework for players, items, and jobs | Yes |
ox_target or qb-target | Target system for interactions | Optional |
Config.System = "textui".Installation
Step 1 — Drop the Resource
Place the flake_bodybag folder into your server's resources directory and add to server.cfg:
Step 2 — Database
The script auto-creates the ck_backup table on resource start. No manual SQL is required. Ensure oxmysql is running before flake_bodybag.
Step 3 — Add Items
Add the following items to your inventory configuration if you want item requirements:
- Bodybag — Required to bag a dead player (configurable).
- Coffin — Required to place a bodybagged player into a coffin (configurable).
- Shovel — Required to bury a body at a cemetery (configurable).
Step 4 — Configure
Edit config/config.lua to match your framework, target system, and desired features.
Done
File Structure
flake_bodybag/ ├── client/ │ └── client.lua -- Client logic, animations, target zones ├── server/ │ └── server.lua -- Server logic, CK backup, database I/O ├── config/ │ ├── config.lua -- Main settings (escrow-ignored) │ ├── edits.lua -- Notifications and TextUI (escrow-ignored) │ └── dumpbury.lua -- Locations and animations (escrow-ignored) └── fxmanifest.lua -- Resource manifest
Configuration
All configuration files are escrow-ignored and safe to modify.
Framework Settings
| Setting | Default | Description |
|---|---|---|
Config.System | "ox_target" | Interaction mode: ox_target, qb-target, or textui |
Config.Debug | false | Enable debug prints in server console |
Config.AdminGroups | Array | Groups allowed to use /ck and /unck |
Config.CheckDistance | 3.0 | Max distance to interact with a body |
Config.Distance | 2.0 | Target interaction distance |
Items
| Setting | Description |
|---|---|
Config.BodyBagItem | Item name, amount, remove flag for bodybags |
Config.CoffinItem | Item name, required flag, remove flag for coffins |
Config.Shovel | Item name, required flag, remove flag for burial |
Props
| Setting | Default | Description |
|---|---|---|
Config.BodyBagProp | "xm_prop_body_bag" | Prop model for bodybags |
Config.WeightedCoffinProp | "prop_coffin_01" | Prop model for coffins |
Locations
Burial and dump sites are configured in config/dumpbury.lua. Each location supports:
coords—vec3(x, y, z)radius— Zone radius for detectionpedModel— (dump only) NPC model for handoffwaitTime— (dump only) Delay before pickuplabel— Display name for the location
Discord Logging
All CK, bury, dump, and UnCK actions are logged to a configurable Discord webhook. Set Config.Logs.enable to true and provide your webhook URL.
Usage
Bodybagging a Player
- Approach a dead player.
- Use your target system or press E (TextUI) to initiate bodybagging.
- Complete the progress-bar animation.
- The dead player is placed inside a bodybag prop and hidden from view.
Placing in a Coffin
- Approach a bodybagged player.
- Select Place in Coffin from the target menu.
- Complete the animation to replace the bodybag with a coffin prop.
Burying a Body
- Carry or drag the bodybag to a burial site (marked on the map if blips are enabled).
- Use the target option or press E to begin burying.
- If configured, you must have a shovel in your inventory.
- Complete the digging animation to finish the burial.
Dumping in the Ocean
- Transport the coffin to a dump pier (marked on the map if blips are enabled).
- Use the target option or press E to push the coffin into the water.
- The coffin is deleted and the player is permanently removed.
Irreversible
Features
Character Kill (CK) System
- Full Backup — Character data, inventory snapshot, vehicles, and metadata are saved to
ck_backup. - Safe Deletion — The player is kicked first, then character and vehicle rows are deleted from the framework tables.
- Discord Audit — Every CK is logged with admin name, victim name, identifiers, and timestamp.
- Funeral Broadcast — A breaking-news announcement is shown to all online players.
UnCK Restoration
- Use
/unckto open a searchable list of all CKed characters. - Select a character and confirm restoration.
- Character data and vehicles are reinserted into the framework tables.
- The backup entry is deleted after successful restoration.
Ambulance Compatibility
- Wasabi Ambulance
- AK47 AmbulanceJob (ESX & QB)
- QB-AmbulanceJob (metadata & state bags)
- Native ped death checks (fallback)
Gulag Integration
If flake_gulag is installed and Config.GulagScript is enabled, burying or dumping will send the player to the gulag instead of deleting their character.
Commands
| Command | Access | Description |
|---|---|---|
/ck [id] | Admin | Permanently kill a player's character with full backup |
/unck [name] | Admin | Open the CK restoration menu. Optional name filter. |
Tip
Config.CKCommand and Config.UnCKCommand. Chat suggestions are registered automatically.Troubleshooting
| Issue | Fix |
|---|---|
| Target options not showing | Ensure ox_target or qb-target is started and Config.System matches. |
| Bodybag prop not spawning | Verify the prop model exists in your server build. Most use base-game props. |
| CK command not working | Check that your player group is listed in Config.AdminGroups. |
| Backup not saving | Ensure oxmysql is running and the ck_backup table was created. |
| Discord logs not sending | Verify the webhook URL in Config.Logs.webhook and that Config.Logs.enable is true. |
| Gulag not triggering | Ensure flake_gulag is started and Config.GulagScript is enabled. |
| Player not detected as dead | Check that your ambulance script is supported or that native death checks are enabled. |
