Delete me 3

the link you sent me is exactly what I put in my client file.

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if IsControlJustPressed(1, 18) and IsPlayerDead(ped) then
        	revivePed()
        	TriggerEvent("chatMessage", "::", {255, 0, 0}, "^1Revived :::")
        end
    end
end)

function revivePed(ped) -- Credits to @Turtle
	local ped = GetPlayerPed(-1)
	local playerPos = GetEntityCoords(ped, true)

	NetworkResurrectLocalPlayer(playerPos, true, true, false)
	SetPlayerInvincible(ped, false)
	ClearPedBloodDamage(ped)
end

and you added the no respawn function? should work just fine, atleast it does for me.

well I put it like this, which Iā€™m sure is wrong but I donā€™t know enough to know why

-- Turn off automatic respawn here instead of updating FiveM file.
AddEventHandler('onClientMapStart', function()
	exports.spawnmanager:setAutoSpawn(false)
	exports.spawnmanager:spawnPlayer()
end)

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        if IsControlJustPressed(1, 18) and IsPlayerDead(ped) then
        	revivePed()
        end
    end
end)

function revivePed(ped) -- Credits to @Turtle
	local ped = GetPlayerPed(-1)
	local playerPos = GetEntityCoords(ped, true)

	NetworkResurrectLocalPlayer(playerPos, true, true, false)
	SetPlayerInvincible(ped, false)
	ClearPedBloodDamage(ped)
end

It works perfectly for me, what exactly is bugging for you?

I cleared all my extra resources off before I tested this just to be sure. It still autorespawns, the button works as long as you push it before you respawn. Though it works correctly if I change this in spawnmanager to false.

-- changes the auto-spawn flag
function setAutoSpawn(enabled)
    autoSpawnEnabled = false
end

are you adding the resource after you connect to the server? then it would never update as you already have the map loaded

Are you referring to the order of resources in the citmp-server.yml? Or are you saying making changes while the server is still running?

are you connected to the server when you start the respawn/revive resource?
I have no idea as to why it isnā€™t working for you, try clearing cache

I donā€™t really understand what you mean. I start the server then start the fivem up and join the server. I spawn as the skater kid, noclip into the sky and suicide, and itā€™ll fade out and respawn me at a spawnpoint if I donā€™t press the button.

This should be working, you probably have another piece of code that is also handling spawns which overrides this.

Well I made a completely new server and had only this script on, and it works but only for the first connected player. The other player just dies, ragdolls, and canā€™t respawn.

is there a way to stop RPDeath from spawning people randomly? when they first join the server? i have a script that spawns people in paleto but if i add this one it makes people spawn in different areas.

is it also possible to make it so instead of toggling no respawon on death that its just always on so they got to /respawn to be /revived?

@TheStonedTurtle can i type /revive id and revive a player as in what a medic can do. ive been trying to find an emergancy mod replacement and this might be it

Remove exports.spawnmanager:spawnPlayer() from RPDeath client.lua. This will require you to spawn them in some other way (which you seem to already be doing).

Iā€™m not sure what you are asking in your second question. The RPDeath script is turned on by default so they must type /respawn or /revive.


@bluefir111, The `RPDeath` script should be what you are looking for, test it out :)

its on by default? because when i die it instantly respawns me after words if i dont turn it on first but maybe its because of my spawn script. iā€™ll try what you said and see if that works.

@TheStonedTurtle any chance of a FXServer port?

Once the FxServer is officially released Iā€™ll work on porting them over, Iā€™ve ran into a couple issues that have been fixed by the FxServer being updated and no code changes being needed.

ok so there is a bug were if you die it does not keep you dead until you are revived, the script works though

like some other people i just die now and respawn and dont go into ragdol

Yeah it was working fine last night now its all screwy.