# fnx-deathsystem-v2

### How can i use this resource?

First of all, you need to download the dependencies of our script, you can choose the circle progressbar and the simple progressbar

* [rprogress ](https://github.com/Mobius1/rprogress)

or&#x20;

* [progressbar](https://github.com/quasar-scripts/progressbar)

Remember to disable esx\_ambulancejob and remove all /revive command registered on your server.

### What should I change in the config?

this is a very subjective question, in the config you will find many configurations, such as that of the phone you are using, the respawn time and much more.

### Where are the trigger to revive a player?

&#x20; Client side example

```
-- to set full player healt
TriggerClientEvent("fnx-death_system:setHeal", true)

-- to set a specific healt value 
TriggerClientEvent("fnx-death_system:setHeal", 50)

```

Server side example

```
-- to set full player healt
TriggerClientEvent("fnx-death_system:setHeal", source, true)

-- to set a specific healt value 
TriggerClientEvent("fnx-death_system:setHeal", source, 50)

```

### When I die and I am revived, the menus no longer open.

being our custom death system, you may encounter this problem with the resource. You need to change the checks that the script does when you open a menu, usually it checks if your player is dead or alive with the basic ESX system, to solve this issue you need to replace the control of the death state of your player.

```
RegisterNetEvent("fnx-death_system:updatedeath")
AddEventHandler("fnx-death_system:updatedeath", function(bool)
    isDead = bool
end)

if isDead then 
    print('player alive')
    else 
    print('Player death')
end
```

### I use ox\_inventory, how can i adapt the death to it?

it is very simple, you will first have to deactivate the weapon wheel and replace the controls, a video tutorial follows to facilitate you.

{% embed url="<https://youtu.be/2IiiAMprJAk>" %}

After, remember to add this line at the bottom of the client.lua of ox\_inventory

```
Citizen.CreateThread(function()
	while true do 
		Citizen.Wait(0) 
		BlockWeaponWheelThisFrame() 
		DisableControlAction(0, 37, true) 
		DisableControlAction(0, 199, true) 
	end 
end)
```

example:

![](https://807306352-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYyUqsAFg0fc2f2rIKA9A%2Fuploads%2FbNkgmN2ZjFQ9GRX3ILjC%2Fimage.png?alt=media\&token=48848ec1-dcf5-4bd5-a8cd-bc5711dfbb85)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://peppesess.gitbook.io/fenix-development-documentation/resources/fnx-deathsystem-v2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
