Flake Physical Therapy
A physical therapy and rehabilitation system for FiveM. Players complete guided exercise steps to recover from injuries and remove crutches.
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
| Dependency | Purpose | Required |
|---|---|---|
ox_lib | Progress bars, callbacks, notifications, TextUI | Yes |
| ESX / QBX / QB-Core | Framework for players, jobs, money, items | Yes |
ox_target or qb-target | Target interaction system | Optional |
| Wasabi Crutch / AK47 Crutch | Crutch system integration | Optional |
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:
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
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
| Setting | Default | Description |
|---|---|---|
Config.System | "textui" | Interaction mode: ox_target, qb-target, or textui |
Config.Debug | false | Enable debug prints and cooldown list command |
Config.Distance | 2.0 | Interaction distance for TextUI mode |
EMS & Availability
| Setting | Default | Description |
|---|---|---|
Config.EMSJobs | { 'ambulance', 'ems' } | Job names counted as EMS |
Config.EMSCount | 0 | Minimum 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
| Field | Type | Description |
|---|---|---|
coords | vec4 | Marker / blip location |
cost | Number | Price for therapy at this location |
showBlip | Boolean | Show map blip for this location |
ped.model | String | NPC model name |
ped.coords | vec4 | NPC spawn position and heading |
steps | Array | Up 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
- Visit a therapy location (marked with a green blip if enabled).
- Approach the NPC and interact via target or press E (TextUI).
- The server validates EMS count, cooldown, and payment / doctor slip.
- If approved, follow the yellow markers to each exercise step.
- 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
| Script | Resource Name | Auto-Remove |
|---|---|---|
| Wasabi Crutch | wasabi_crutch | Yes |
| AK47 Crutch (ESX) | ak47_crutch | Yes |
| AK47 Crutch (QB) | ak47_qb_crutch | Yes |
Don't have a crutch system?
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
Troubleshooting
| Issue | Fix |
|---|---|
| NPC not spawning | Ensure the ped model exists in your server build. Most use base-game models. |
| Target option not showing | Verify Config.System matches your installed target resource. |
| Therapy denied โ EMS | Check Config.EMSCount and Config.EMSJobs. Set count to 0 to disable the check. |
| Therapy denied โ cooldown | Wait for the cooldown to expire or disable it in config. |
| Therapy denied โ no money | Ensure the player has enough cash (not bank) for the location cost. |
| Crutch not removed after therapy | Verify the crutch resource is named correctly and started. Check console for errors. |
| Step markers not appearing | Ensure step coordinates are within the world bounds and not underground. |
| Animation not playing | Verify the animation dictionary exists. Use a tool like GTA5 Animations to confirm. |
