[help] Loose money at death for essensial

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.

1 Like