HomeDocumentationFlake Physical Therapy
๐Ÿฅ

Flake Physical Therapy

A physical therapy and rehabilitation system for FiveM. Players complete guided exercise steps to recover from injuries and remove crutches.

FiveMESX ยท QBX ยท QBox_libLua 5.4
Purchase Script
flakedev.com

Overview

Physical therapy brings immersive rehabilitation to your server. Injured players visit a therapy location, complete guided exercise steps, and have crutches removed upon completion.

Features

  • Dual Framework โ€” Auto-detects ESX, QBX, or QB-Core.
  • Multi-Step Therapy โ€” Configurable 3-step exercise chain per location.
  • Crutch Integration โ€” Compatible with Wasabi Crutch and AK47 Crutch.
  • Doctor Slip Item โ€” Optional item to bypass payment.
  • EMS Check โ€” Require minimum EMS online or allow always.
  • Cooldown System โ€” Prevent spam with per-player cooldowns.
  • Flexible Interaction โ€” ox_target, qb-target, or TextUI + E key.
  • Per-Location Pricing โ€” Set different costs for each therapy site.
  • Custom Animations โ€” Each step supports its own animation dictionary and clip.

Requirements

DependencyPurposeRequired
ox_libProgress bars, callbacks, notifications, TextUIYes
ESX / QBX / QB-CoreFramework for players, jobs, money, itemsYes
ox_target or qb-targetTarget interaction systemOptional
Wasabi Crutch / AK47 CrutchCrutch system integrationOptional
Target systems are optional. Set Config.System = "textui" to use TextUI prompts with the E key instead.

Installation

Step 1 โ€” Ensure the Resource

Place the flake_physicaltherapy folder into your server's resources directory and add to server.cfg:

ensure flake_physicaltherapy

Step 2 โ€” Add Items (Optional)

If you want to use the doctor slip item bypass, add the configured item to your inventory:

Config.DoctorSlipItem = {
    enable = true,
    item   = 'docslip'
}

Step 3 โ€” Configure

Edit config/config.lua to set your framework, interaction system, EMS jobs, locations, and pricing.

Done

Restart your server and therapy locations will spawn with NPCs and markers.

File Structure

flake_physicaltherapy/
โ”œโ”€โ”€ client/
โ”‚   โ”œโ”€โ”€ client.lua            -- Therapy logic, animations, steps
โ”‚   โ””โ”€โ”€ cl_notifications.lua  -- Notification overrides
โ”œโ”€โ”€ server/
โ”‚   โ”œโ”€โ”€ server.lua            -- EMS checks, money, cooldowns
โ”‚   โ””โ”€โ”€ sv_notifications.lua  -- Notification server bridge
โ”œโ”€โ”€ config/
โ”‚   โ”œโ”€โ”€ config.lua            -- Main settings (escrow-ignored)
โ”‚   โ””โ”€โ”€ editable.lua          -- Notifications and TextUI (escrow-ignored)
โ””โ”€โ”€ fxmanifest.lua        -- Resource manifest

Configuration

All tunables live in config/config.lua and config/editable.lua. These files are escrow-ignored.

Framework & Interaction

SettingDefaultDescription
Config.System"textui"Interaction mode: ox_target, qb-target, or textui
Config.DebugfalseEnable debug prints and cooldown list command
Config.Distance2.0Interaction distance for TextUI mode

EMS & Availability

SettingDefaultDescription
Config.EMSJobs{ 'ambulance', 'ems' }Job names counted as EMS
Config.EMSCount0Minimum EMS online required (0 = always available)

Cooldowns

Config.Cooldown = {
    enable = true,
    time   = 600  -- seconds (10 minutes)
}

Doctor Slip

When enabled, players with the item skip payment entirely. The item is consumed on use.

Config.DoctorSlipItem = {
    enable = true,
    item   = 'docslip'
}

Location Settings

FieldTypeDescription
coordsvec4Marker / blip location
costNumberPrice for therapy at this location
showBlipBooleanShow map blip for this location
ped.modelStringNPC model name
ped.coordsvec4NPC spawn position and heading
stepsArrayUp to 3 therapy steps

Step Configuration

{
    coords = vec4(322.37, -592.38, 43.28, 68.94),
    progress = {
        duration  = 20000,
        label     = 'Leg Stretching...',
        canCancel = false,
        disable   = { move = true, combat = true },
        anim = {
            dict = 'mini@triathlon',
            clip = 'idle_e',
            flag = 7
        }
    }
}

Usage

Starting Therapy

  1. Visit a therapy location (marked with a green blip if enabled).
  2. Approach the NPC and interact via target or press E (TextUI).
  3. The server validates EMS count, cooldown, and payment / doctor slip.
  4. If approved, follow the yellow markers to each exercise step.
  5. Complete all steps to finish therapy and have your crutch removed.

Payment Flow

  • If you have a doctor slip, it is consumed and therapy is free.
  • Otherwise, the location's cost is deducted from your cash.
  • If you cannot afford it, the session is denied.

Step Markers

Each therapy step spawns a yellow marker visible from 50 meters. Stand within 2 meters and press E to begin the progress bar animation. Movement and combat are disabled during each step.

Crutch Support

Integrates with popular crutch scripts to automatically remove crutches after therapy completion.

Supported Scripts

ScriptResource NameAuto-Remove
Wasabi Crutchwasabi_crutchYes
AK47 Crutch (ESX)ak47_crutchYes
AK47 Crutch (QB)ak47_qb_crutchYes

Don't have a crutch system?

Click any script name above to purchase it from the original store. Flake Physical Therapy works out of the box with all three.

Crutch Requirement

When wasabi_crutch is running, therapy can only be started if the player is actively using a crutch. Other crutch systems do not expose an active check and will allow therapy regardless.

Doctor Slip Removal

Players can also use a doctor slip item to remove their crutch immediately without visiting a therapy location.

Adding Locations

New therapy sites can be added by copying the existing location block in config/config.lua:

Config.TherapyLocations = {
    MyNewLocation = {
        coords   = vec4(100.0, 200.0, 30.0, 90.0),
        cost     = 1000,
        showBlip = true,
        ped = {
            model  = 's_m_m_doctor_01',
            coords = vec4(100.0, 200.0, 30.0, 90.0),
        },
        steps = {
            {
                coords = vec4(102.0, 202.0, 30.0, 0.0),
                progress = {
                    duration  = 15000,
                    label     = 'Warm Up...',
                    canCancel = false,
                    disable   = { move = true, combat = true },
                    anim = {
                        dict = 'mini@triathlon',
                        clip = 'idle_e',
                        flag = 7,
                    },
                },
            },
            -- Add up to 3 steps
        },
    },
}

Tip

Locations with fewer than 3 steps skip the missing ones automatically. You can create 1-step, 2-step, or 3-step therapy sites.

Troubleshooting

IssueFix
NPC not spawningEnsure the ped model exists in your server build. Most use base-game models.
Target option not showingVerify Config.System matches your installed target resource.
Therapy denied โ€” EMSCheck Config.EMSCount and Config.EMSJobs. Set count to 0 to disable the check.
Therapy denied โ€” cooldownWait for the cooldown to expire or disable it in config.
Therapy denied โ€” no moneyEnsure the player has enough cash (not bank) for the location cost.
Crutch not removed after therapyVerify the crutch resource is named correctly and started. Check console for errors.
Step markers not appearingEnsure step coordinates are within the world bounds and not underground.
Animation not playingVerify the animation dictionary exists. Use a tool like GTA5 Animations to confirm.
Developed by Flake Development. For support, open a ticket in our Discord.