Bodybag Script
Resource folder:
gs_bodybag
Installation Instructions for Bodybag Script
Follow these steps to install and configure
gs_bodybag on your FiveM server.
-
Download the Resource
- Go to portal.cfx.re
-
Navigate to Assets > Granted Assets >
gs_bodybag - Download the resource
-
Extract the Files
-
Open the downloaded
.zipfile -
Inside, you'll find a folder named
gs_bodybag -
Move the entire
gs_bodybagfolder into your desired server resources folder (e.g.,/resources/[scripts])
-
Open the downloaded
-
Add to Server Configuration
- Open your
server.cfg -
Add the following line:
ensure gs_bodybag
- Open your
-
Restart the Server
- Restart your FiveM server (Important!)
-
Configure the Script (Optional)
- Navigate to
gs_bodybag/config.lua - Edit the configuration options to fit your server's needs
- Navigate to
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.
Add the following items to your ox_inventory/data/items.lua
file:
['bodybag'] = {
label = 'Bodybag',
weight = 250,
},
Execute the following SQL query to add the items to the database:
INSERT INTO
`items` (`name`, `label`, `weight`, `rare`, `can_remove`)
VALUES
('bodybag', 'Bodybag', 0, 0, 1);
Add the following items to your qb-core/shared/items.lua
file:
['bodybag'] = {
['name'] = 'bodybag',
['label'] = 'Bodybag',
['weight'] = 250,
['type'] = 'item',
['image'] = 'bodybag.png',
['unique'] = false,
['useable'] = false,
['shouldClose'] = true,
['combinable'] = nil,
},
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:
- Confirm ox_target or qb-target is running (renamed resources may not be detected).
- Disable job and item requirements temporarily for testing.
- Make sure the target is fully dead, not in last stand.
- Edit
Functions.CanTargetBePlacedInBodybaginbridge/cl_bridge.luafor your ambulance script. - Update to the latest script version (1.0.2+ has improved ak47 and qbx support).
- 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.