> For the complete documentation index, see [llms.txt](https://daddy-studios.gitbook.io/daddy-studios-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://daddy-studios.gitbook.io/daddy-studios-docs/scripts/daddy-deathscreen/integration.md).

# Framework Integration

Daddy Deathscreen reads the death state of your ambulance script automatically. The only change you have to make is to **stop your ambulance script from drawing its own death texts**, otherwise both texts are on screen at the same time. Keep every key and timer line, remove only the lines that draw text.

## Qbox (`qbx_medical` + `qbx_ambulancejob`)

Status: **supported**.

File: `qbx_ambulancejob/client/setdownedstate.lua`

Add this **one line** right below `local doctorCount = 0` (line 3):

```lua
local qbx = setmetatable({ drawText2d = function() end }, { __index = qbx })
```

It turns the six `qbx.drawText2d(...)` calls of this file into no-ops, nothing else changes. The EMS alert key (G) keeps working. Restart `qbx_ambulancejob` afterwards. To undo it, delete the line.

The timers, the respawn hold, the attacker and the weapon come from `qbx_medical`, no setting is needed. Set `Config.RespawnFee` to `checkInCost` from `qbx_ambulancejob/config/shared.lua` (default 2000).

`Config.BlockEarlyRespawn` (default `true`): `qbx_medical` lets a dead player hold E to respawn at any time. With this on, E is blocked until the death timer ends, then `qbx_medical` sends the player to the hospital automatically. Set it to `false` to keep the Qbox default.

## QBCore (`qb-ambulancejob`)

Status: **supported**.

File: `qb-ambulancejob/client/dead.lua`

In the main `CreateThread` near the end of the file, remove the `DrawTxt(...)` lines inside `if isDead then` and `elseif InLaststand then`. They print `info.respawn_txt`, `info.respawn_revive`, `info.bleed_out`, `info.bleed_out_help`, `info.request_help` and `info.help_requested`. Keep the `IsControlJustPressed(0, 47)` block, it sends the EMS alert.

The state is read from the player metadata `isdead` and `inlaststand`. The timers of `qb-ambulancejob` are local variables, so set `Config.Timers.qb` to your `Config.DeathTime` and `Config.ReviveInterval` (defaults 300 and 360), and `Config.RespawnFee` to `Config.BillCost` (default 2000).

## ESX (`es_extended` + `esx_ambulancejob`)

Status: **supported**.

File: `esx_ambulancejob/client/main.lua`

* In `StartDeathTimer`, remove the text lines that end with `DrawText(0.5, 0.8)`, together with the `DrawGenericTextThisFrame()`, `SetTextEntry` and `AddTextComponentString` lines right above them. Keep the timer loops and the `IsControlPressed(0, 38)` respawn logic.
* In `StartDistressSignal`, remove the text drawing lines (`SetTextFont` ... `EndTextCommandDisplayText`). Keep the `IsControlJustPressed(0, 47)` block, it sends the distress signal.
* Optional: remove `StartScreenEffect('DeathFailOut', 0, false)` in `OnPlayerDeath` if you prefer the grey-out of Daddy Deathscreen.

Death comes from the `es_extended` event `esx:onPlayerDeath` (with the killer and the cause), revive from `esx_ambulancejob:revive` and `esx:onPlayerSpawn`. ESX has no last stand. Set `Config.Timers.esx.dead` to `Config.EarlyRespawnTimer / 1000` (default 60), and `Config.RespawnFee` to `EarlyRespawnFineAmount` when `EarlyRespawnFine` is on, otherwise `0`.

## Other ambulance scripts

Call the [exports](/daddy-studios-docs/scripts/daddy-deathscreen/exports.md) from the death and revive code of your script:

```lua
exports['daddy-deathscreen']:OpenDeathscreen(300, { state = 'dead' })   -- or state = 'laststand'
exports['daddy-deathscreen']:CloseDeathscreen()
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://daddy-studios.gitbook.io/daddy-studios-docs/scripts/daddy-deathscreen/integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
