ESX • QBCore • Qbox compatible
Instant download
Updates included
Discord support
Secure checkout

Bodybag Script

Resource folder: gs_bodybag

View product

Installation Instructions for Bodybag Script

Follow these steps to install and configure gs_bodybag on your FiveM server.

  1. Download the Resource
    • Go to portal.cfx.re
    • Navigate to Assets > Granted Assets > gs_bodybag
    • Download the resource
  2. Extract the Files
    • Open the downloaded .zip file
    • Inside, you'll find a folder named gs_bodybag
    • Move the entire gs_bodybag folder into your desired server resources folder (e.g., /resources/[scripts])
  3. Add to Server Configuration
    • Open your server.cfg
    • Add the following line:
      ensure gs_bodybag
  4. Restart the Server
    • Restart your FiveM server (Important!)
  5. Configure the Script (Optional)
    • Navigate to gs_bodybag/config.lua
    • Edit the configuration options to fit your server's needs

Additional documentation

No target option to bodybag?

Dead players are detected by the function Functions.CanTargetBePlacedInBodybag located in gs_bodybag/bridge/cl_bridge.lua. In case you do not have a target option to bodybag a dead player, double check this function to see if the death-system you are using is implemented. Otherwise you may need to slightly adjust this function.

Recommended adjustment for respawning players

There are two server-sided exports available:

exports.gs_bodybag:AddBodybag(playerServerId)
exports.gs_bodybag:RemoveBodybag(playerServerId)

Within your respawn-script, you should add the RemoveBodybag export to ensure the bodybag is properly cleaned up when a player respawns.

Included images
Installation Instructions

Does bodybag permanently kill players or wipe inventory?

No. By default, gs_bodybag only places an already dead player inside a bodybag prop, or removes them again. It does not kill players, wipe inventory, delete characters, force respawn, or save anything to a database. It is a visual RP tool. Death handling, CK, hospital teleport, and inventory wipe are your ambulance or death system's job.

Is this the same as other bodybag scripts that auto-respawn and wipe characters?

No. Some bodybag scripts auto-respawn players, broadcast news, and wipe characters. Gamzky gs_bodybag bags a dead body and leaves respawn and CK logic to your ambulance job. Check the showcase and docs before purchase if you expect automatic character deletion.

What do I need to run this script?

You need ox_target or qb-target. There is no usable command; interaction is through third-eye on dead players. ox_lib is required for some death-system bridge code (for example qbx_ambulancejob). ESX, QBCore, Qbox, and standalone with target are supported. The bodybag inventory item is optional and only checked when Config.RequiredItem.Enabled = true.

Does bodybag use a database?

No. Bodybag state is runtime only through state bags and networked props. Nothing persists across restarts.

Using the bodybag item from inventory does nothing

That is expected. The item is not a use-from-inventory action. Target a dead player with ox_target or qb-target to place them in a bodybag. Using the item directly may only consume or remove it without doing anything useful.

No bodybag option appears when I target a dead player

This is the most common issue. Check these in order:

  1. Confirm ox_target or qb-target is running (renamed resources may not be detected).
  2. Disable job and item requirements temporarily for testing.
  3. Make sure the target is fully dead, not in last stand.
  4. Edit Functions.CanTargetBePlacedInBodybag in bridge/cl_bridge.lua for your ambulance script.
  5. Update to the latest script version (1.0.2+ has improved ak47 and qbx support).
  6. Do not partially edit Functions.AddGlobalTargetOptions; broken target registration removes the bodybag option entirely.

I see "No target interaction defined" in the console

No supported target system was detected. Custom or VRP-integrated target menus without standard addGlobalPlayer exports will not work out of the box. ox_target is strongly recommended.

The target option flashes briefly and disappears (ak47_ambulance)

ak47's death state can make the option flicker. Update to the latest gs_bodybag version or replace Functions.CanTargetBePlacedInBodybag with ak47-specific dead detection in bridge/cl_bridge.lua.

wasabi_ambulance reports dead players in last stand

wasabi can treat knocked-out or last-stand players as dead. Use player state to distinguish 'dead' from 'laststand' in Functions.CanTargetBePlacedInBodybag so bodybag only works on fully dead players.

How do I integrate qbx_ambulancejob or qbx_medical?

This is not supported out of the box. You typically need to add @ox_lib/init.lua to shared scripts, resolve the server ID with GetPlayerFromPed(entity), and check death status through qbx_ambulancejob callbacks. Prevent dead players from removing themselves by checking exports.qbx_medical:IsDead() in canInteract.

Dead players can remove themselves from the bodybag

Add a guard in Functions.AddGlobalTargetOptions so the remove option is not available to dead players. Use your medical export or disable ox_target while dead globally.

Player is invisible or stuck after respawn, or the bodybag prop remains

Call bodybag cleanup in your ambulance respawn code, not inside gs_bodybag core:

exports.gs_bodybag:RemoveBodybag(playerServerId)

Or from the client during respawn:

TriggerServerEvent('gs_bodybag:RemoveBodybagForPlayer')

For wasabi, add this inside StartRPDeath before hospital check-in. You may also need to reset visibility, collision, and freeze state if the ped was hidden in the bag.

Bodybag only works once per player until they reconnect

Stale bodybagNetId state is usually the cause. Call RemoveBodybag on every respawn and revive path in your medic script.

Can players carry or move the bodybag?

No. Carry scripts re-attach the player ped and leave an empty bag on the ground. Moving the bag into a vehicle is also not supported. Stretcher scripts generally conflict for the same reason.

How do I check if a player is currently in a bodybag from another script?

local netId = Player(serverId).state.bodybagNetId
-- nil = not in a bag; any other value = in a bag

Can I trigger respawn, teleport, or inventory wipe when someone is bodybagged?

Yes, through bridge hooks such as Functions.OnBodybagCreated in bridge/cl_bridge.lua. Wire that to your death system (wasabi, ak47, custom graveyard teleport, and so on). gs_bodybag does not do this automatically.

brutal_ambulancejob says the player is not dead

exports.brutal_ambulancejob:IsDead(serverId) has returned false while the player looked dead. Contact Brutal Scripts or switch to a supported ambulance job such as wasabi, ak47, or esx_ambulancejob.