Delete me 3

Is there a way to disable the 5m wait when reviving? So if I die, I can revive myself straight away?

You should just be able to call /revive

It says I have to wait 5 minutes before I can revive myself. But if someone else revives me, then I can get up right away.

Weird, I could’ve sworn last time I used this that worked.

Removing this should allow you to revive yourself, but it’ll also allow anyone to revive themselves:

-- Trying to revive themselves?
	if(GetPlayerServerId(PlayerId()) == from and diedTime ~= nil)then
		local waitPeriod = diedTime + (reviveWaitPeriod * 1000)
		if(GetGameTimer() < waitPeriod)then
			local seconds = math.ceil((waitPeriod - GetGameTimer()) / 1000)
			local message = ""
			if(seconds > 60)then
				local minutes = math.floor((seconds / 60))
				seconds = math.ceil(seconds-(minutes*60))
				message = minutes.." minutes "
			end
			message = message..seconds.." seconds"
			TriggerEvent('chatMessage', "RPDeath", {200,0,0}, "You must wait before reviving yourself, you have ^5"..message.."^0 remaining.")
			return		
		end
	end
1 Like

So I just delete that whole section you quoted? I’ll have to try it. That’s what I was after. Thanks!

No problem, glad to help!

I put this in my server and works fine but everytime someone dies everyone in game crashes

Is there a way to set an auto respawn if fhe person isnt revived by command?

Im sure i missed it or i set it wrong cause i set it where people cant revive themselves for a certain amount of time but that isnt what i was trying to achieve.

@ExiledSpark Change line 125 of client.lua:

if(diedTime == nil)then
	diedTime = GetGameTimer()
end

to

if(diedTime == nil)then
	diedTime = GetGameTimer()
else 
	local waitPeriod = diedTime + (reviveWaitPeriod * 1000)
	if(GetGameTimer() > waitPeriod)then
		TriggerEvent('RPD:allowRevive')
	end
end

This will trigger a self revive after X time has passed, the script should already prevent them from reviving themselves before that time has passed.

To make the player Respawn instead of Revive change the TriggerEvent('RPD:allowRevive') to TriggerEvent('RPD:allowRespawn')

I think I broke it.

Now everyone is respawning constantly even after changing it back.

Hello!

I seem to have a problem with RPDeath.

When the timer was set to 300 seconds, it worked jsut fine.

Now when I tried it with first 0 seconds, and then 5 seconds it didn’t work, both the times.

I put /revive into chat, but nothing happened. The command didn’t appear in chat either, which means the script runs. Tried to restart the script with IceCon, even reinstalled it.

What am I doing wrong?

Thanks in advance
Szymon.

change the 300 to 1 it then works :slight_smile:

Nope. Didn’t help. My character still lays on the ground, and nothing happens when I do /revive :(.

Can’t even do Clean & heal player in Lambda.

Are you getting any error messages? I just tried setting it to 0 and it worked as expected.

local reviveWaitPeriod = 0

No error messages. Tried reinstalling the script, and this is the only thing I changed. It was working fine when it was set to 300 seconds, as my friend got a bit mad that he had to wiat 4 minutes after i accidentally killed him with a car :D.

Could it be vBasic that breaks the script? vBasic is the only script I installed inbetween the accident with my friend, and changing the /revive time.
(Didn’t think about this before now. Will check it when I come home.).

there is 0 reason why changing that variable value to 0 would cause it to fail and no reason why another resource would only interfere when that value is changed.

Ikr. It worked, and then it stopped working. Just lile that. Without me doing anything, but changing the value, and installing vBasic.

Maybe it’s an animation bug?

Couldn’t /revive, so I stopped the script with ā€œstop RPDeathā€ in IceCon.
I then checked if it was off by doing /revive, and it came up in chat, so it was off.

I then turned on noclip, and went back out of it. That fixed the problem.

When I come home, I“ll check if the same things happens without stopping the script.

Still doesn’t work :/.

And yes, noclipping makes it able to move again, but I am still ā€œdeadā€, as I cannot choose a weapon (Or I can, but the wheel doesn’t show up, so I don’t know what I am choosing), and I can’t open the pause menu.

Vbasic would cause exactly that. I have tested it before. You cant drive, choose weapons, use pause menu, etc. Disabling it should fix it.

Edit: Realised you said it still didnt work. Are you sure you disabled it? Also maybe clear cache? I dont think that would have much to do with it but you can try.

Clearing cache after every new plugin I install. Will disable vBasic and try again!