Kartik Scripts

Exports & Events

For developers connecting other scripts to the medical system.


🎯 The two you will actually use

Slow down your script for injured players

duration = 5000 * exports['kartik-ambulancejob']:getActionSpeed()

Wire this into lockpicking, crafting, jobs and heists and a broken arm slows down a player's entire life, not just their combat. Highest value for least effort.

Hook your drug items into addiction

-- once, on resource start
exports['kartik-ambulancejob']:RegisterAddictiveDrug('oxy', {
    class = 'opioid',
    addiction = { type = 'opioid', gain = 20 },
    overdose = { doses = 3, window = 900, disease = 'opioid_overdose' },
})

-- every time the item is used
exports['kartik-ambulancejob']:RecordDrugUse(source, 'oxy')

See Addictions & Overdoses.


🔄 Legacy compatibility

If your script already talks to qbx_medical, qb-ambulancejob or esx_ambulancejob, you do not need to change anything. Those exports and events are answered by the compatibility layer.

Supported:

  • qbx_medical exports and events, and its isDead / qbx_medical:deathState state bags, pma-voice, phones and appearance menus that check them keep working
  • qb-ambulancejob, esx_ambulancejob and wasabi_ambulance exports
  • hospital:client:Revive, hospital:client:HealInjuries, esx_ambulancejob:revive and friends

The full list is in Events & State Bags → Legacy events.

Setting up an admin menu (919Admin, vMenu, EasyAdmin…)? Its revive hook is in Events & State Bags → Admin menus.

See Config.Compat in General & Compatibility.

On this page