Browse docs

AI Medic

Hook for overriding the built-in AI medic system with a custom implementation.

Config Hook

The onAiMedicRequest hook in config/functions.lua fires when a player presses the AI Medic button on the death screen. Return false to prevent the built-in AI medic from dispatching.

config/functions.lua
Config.Functions.onAiMedicRequest = function()
    -- Use your own medic system instead
    exports['nxt-medic']:sendHelp()
    return false -- prevent built-in AI medic

    -- return true -- default: use built-in AI medic
end

UI State Exports

When overriding the AI medic, use these client exports to update the death screen UI:

client.lua
-- Update the status text on the death screen
exports["sky_ambulancejob"]:setAiMedicState("driving")

-- Show failure
exports["sky_ambulancejob"]:setAiMedicState("failed", "spawn_failed")

-- Reset when done
exports["sky_ambulancejob"]:setAiMedicState("idle")

Available States

StateUI Text
idle(hidden)
requestingContacting emergency services...
dispatchedAI medic en route
drivingAI medic en route
arrivedAI medic on scene
revivingAI medic is stabilising you
finishedAI medic completed the call
failed(depends on reason)
cooldownAI medic cooling down

Failure Reasons

ReasonUI Text
not_enough_moneyNot enough funds
medics_onlineReal medics are on duty
spawn_failedAI medic could not reach you
already_activeAI medic already dispatched
disabledAI medic unavailable

Support

Need help? Our support team is always ready to assist

Join Discord