Hello, i try to make a script for loose money at death for essensial mod can you help me for this ? thanks you !
Be sure to take a look at our Releases section on the forums aswell, since there are some great
examples on it.
If you have any more questions be sure to post back!
Hi, I just did the script for my server, it’s quite easy.
You need to set a clientside script that check if your player is dead.
Then you add a server script that uses the essentialmoney command : user:setMoney ((0))
When your player die, the clientside refers to the serverside script and it sets your money to 0
Could you release it please ?
No work for me, you can send my an exemple ?
I went on this post : Respawn hopital after death
where you can see a guy who posted this :
Citizen.CreateThread(function() while true do Wait(500) local ped = GetPlayerPed(-1) local yourplace = x,y,z if IsEntityDead(ped) then NetworkResurrectLocalPlayer(yourplace, true, true, false) ClearPedTasks(ped) end end end)
Basically it detects when a player dies and it changes his spawnplace to the x,y,z coordinates you want. I just took this code and added under “NetworkResurrect…” a line to set his money to 0. It’s like user:setMoney ((0)) or sth like that in essentialmode.