Kartik Scripts

Addictions & Overdoses

Painkillers have consequences. So do street drugs, if you connect them.

๐Ÿ“ˆ How dependence builds

Every dose of an addictive drug adds points.

DrugPoints per dose
Fentanyl35
Morphine22
Vicodin12
Tramadol10
Dependent at60 points
Maximum100
Decays8 points per hour

So two doses of fentanyl makes you dependent. Three of morphine gets you most of the way there.


๐Ÿ˜ฐ Withdrawal

Once dependent, going 30 minutes without a dose starts withdrawal, and it escalates.

StageAfterSymptoms
1immediatelySweating, shaking
220 minutesShaking, nausea, fatigue, panic
350 minutesNausea, badly reduced stamina, steady health loss

Relief

Any opioid-class medication relieves withdrawal instantly.

Which is the trap. Relieving withdrawal with another dose pushes the addiction score back up. The only real way out is riding it out while the score decays.


โ˜ ๏ธ Overdose

An overdose happens when too many doses land in a short window.

DrugOverdose at
Fentanyl2 doses in 10 minutes
Morphine3 doses in 15 minutes
Tramadol4 doses in 30 minutes
Vicodin4 doses in 30 minutes

What it looks like

StageAfterSymptoms
1immediatelyPinpoint pupils, drowsiness, breathing rate โˆ’8, oxygen โˆ’10
23 minutesPinpoint pupils, passing out, steady health loss

4 minutes after the overdose starts, the patient collapses into last stand.

The cure

Naloxone. One nasal dose reverses it instantly.

  • It also reverses sedatives, so it wakes up a propofol-sedated patient.
  • It is self-usable, a drug user can carry their own Narcan.
  • $60 at the medical supply shop, available at rank 0.

Diagnosing one

A penlight shows pinpoint pupils. A pulse oximeter shows the crashed oxygen saturation. Together they identify an opioid overdose in the field, with no lab test needed.


๐Ÿ”— Connecting your own drug items

If you run a drug script, you can hook its items into this system. Two calls.

Register the drug, once, when your resource starts

exports['kartik-ambulancejob']:RegisterAddictiveDrug('oxy', {
    class = 'opioid',
    addiction = { type = 'opioid', gain = 20 },
    overdose = { doses = 3, window = 900, disease = 'opioid_overdose' },
})
Field
classNaloxone reverses it, and opioid doses relieve its withdrawal
addiction.typeWhich addiction it feeds
addiction.gainPoints per dose
overdose.doses / windowDoses within this many seconds triggers an overdose

Record each use, every time the player uses the item

exports['kartik-ambulancejob']:RecordDrugUse(source, 'oxy')

That is it. Your drug now causes real dependence, real withdrawal and real overdoses, treated by real medics with naloxone.

Your own addiction type

exports['kartik-ambulancejob']:RegisterAddiction('meth', {
    label = 'Meth Dependence',
    threshold = 50,
    withdrawal = { { after = 0, symptoms = { 'shaking', 'panic' } } },
    relievedBy = { 'stimulant' },
})

Reading and clearing

exports['kartik-ambulancejob']:IsAddictiveDrug('oxy')
exports['kartik-ambulancejob']:GetPlayerAddictions(source)
exports['kartik-ambulancejob']:ClearPlayerAddiction(source, 'opioid')  -- nil clears all
exports['kartik-ambulancejob']:IsPlayerOverdosing(source)

Events

'kartik-ambulancejob:server:overdose'          -- (source, 'start' | 'ended' | 'collapsed')
'kartik-ambulancejob:server:addictionChanged'  -- (source, type, level)

๐Ÿ›‘ Turning it off

Config.DiseaseSettings.addictions = false

Medications never cause dependence. Overdoses still work, they are part of the disease system.

On this page