Documentation

🩺 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.