π©Ί QBX Surgery System Documentation
The QBX Surgery System is an advanced medical roleplay script designed for QBX-Core servers. It provides immersive surgery mechanics with patient consent, EMS-only access, and ox_target integration, while remaining lightweight and easy to configure.
π¦ Overview
This script allows EMS and Doctors to:
Perform medical surgery
Stitch wounds
Revive patients
Use surgery beds via ox_target
Respect RP through a mandatory patient consent system
Test features solo using a built-in test command
β Features
/surgery command for EMS & Doctors
ox_target surgery bed interaction
Patient consent popup (required)
Full Surgery, Stitch, and Revive options
Job-locked (EMS / Doctor only)
Built-in solo test mode (/surgerytest)
Progress bars and animations
Configurable surgery times
Lightweight and optimized
Easy integration with ambulance / injury scripts
π Requirements
Before installing, make sure your server has the following:
QBX-Core
ox_lib
ox_target
FiveM Artifact (latest recommended)
π Installation
Download the resource
Place the folder into your server resources directory:
resources/[medical]/qbx-surgery
Add the resource to your server.cfg:
copy this
ensure qbx-surgery
Restart your server ] π§ββοΈ Allowed Jobs
Only the following jobs can perform surgery (configurable):
ambulance
doctor
You can edit allowed jobs in:
shared/config.lua
π Surgery Beds (ox_target)
Surgery beds are defined in the config file and use ox_target for interaction.
copy this
Example:
Config.Beds = {
{
coords = vec3(311.1, -570.9, 43.28),
size = vec3(2.2, 1.2, 1.0),
rotation = 340.0,
label = 'Surgery Bed'
}
}
You can add unlimited beds across multiple hospitals.
π©Ί Surgery Commands
copy this
/surgery
Opens the surgery menu for the closest nearby player.
Available actions:
Full Surgery
Stitch Wounds
Revive
The patient must consent before surgery begins.
copy this
/surgerytest (Test Mode)
Allows EMS/Doctors to test the surgery system without another player.
Uses your own character as the patient
Skips patient consent
Does not consume items
Safe for development and testing
Test mode can be enabled or disabled in the config.
π§ Patient Consent System
When a surgery is requested:
The patient receives a consent popup
The patient must accept or decline
Surgery only proceeds if consent is granted
Declining cancels the surgery immediately
This ensures:
RP fairness
No forced medical actions
Protection against abuse
π§ͺ Test Mode Configuration
Located in shared/config.lua:
Config.TestMode = true Config.TestModeAdminsOnly = false
Disable test mode for production servers if desired
Optionally restrict test mode to admins only
π§° Surgery Items (Optional)
You can require a surgery item for full surgery:
Config.RequireItem = true Config.SurgeryItem = 'surgerykit'
Only required for Full Surgery
Item is removed after patient consent
Stitching and revives do not require items
β± Surgery Timings
Adjust surgery durations (in milliseconds):
Config.Times = { surgery = 25000, stitch = 15000, revive = 12000, }
β€οΈ Healing & Medical Integration
By default, the script applies basic healing. You can integrate your own medical or injury system by editing:
server/main.lua client/main.lua
Look for:
qbx-surgery:client:heal qbx-surgery:client:clearInjuries
These can be hooked into:
qbx_ambulancejob
Wasabi Ambulance
Custom injury / bleeding scripts
π§ Configuration File
All settings are located in:
shared/config.lua
Includes:
Allowed jobs
Surgery item requirements
Test mode toggles
Surgery durations
Surgery bed locations
π Common Issues
Surgery menu not opening
Ensure you are on an allowed job
Ensure ox_lib and ox_target are running
Consent popup not appearing
Ensure the target player is within range
Ensure both players are online and loaded
Revive not working
Replace the revive event with your ambulance scriptβs revive function
π License & Usage
For FiveM servers only
No redistribution or resale
One server per purchase unless otherwise stated
π¬ Support & Custom Development
Need help integrating this with your medical system? Want custom features added?
Support and custom development available through Legendary Development.