Respawn at the hospital and loose money at death

Hello my friends, i have a problem I did a code to respawn at hospital when the player death it works but I want to remove the money cash from the player when he respawn someone could help me ?

losing money interest me too but i didn’t even try yet

up please if someone knows how to proceed

Well if you made an economy system I guess then how do you not know how to cause money to be removed from an account? ;D

Citizen.CreateThread(function()
	while true do
		Wait(0)
		if IsEntityDead(GetPlayerPed(-1)) then
			Wait(15000) -- Time until respawn 15s
			NetworkResurrectLocalPlayer(295.83, -1446.94, 29.97, true, true, false)
			RemoveAllPedWeapons(GetPlayerPed(-1), true)
			ClearPedBloodDamage(GetPlayerPed(-1))
			ClearPedLastDamageBone(GetPlayerPed(-1))
			ClearPedTasks(GetPlayerPed(-1))
		end
	end
end)

this code is to respawn at hospital I already have it, but wher is the line who delete money?

if IsEntityDead(GetPlayerPed(-1)) then

What does “-1” mean ?

it definite all players I think

No, client side,

GetPlayerPed(-1)

returns the player pedestrian

have u found a fix yet im having the same issue