Pointshop Respawn not doing the do.

Hai,
So basically im the owner of a Deathrun server. So Basically I want a pointshop item that when you buy it. You get respawned. The hitch is that the AFK killers… kill you.
So basically I either want the respawn to reset my HP to 100 after a few seconds. Or have godmode toggled for a few seconds.

What I have ATM:


ITEM.Name = 'Respawn'
ITEM.Price = 10000
ITEM.Material = 'models/props_junk/GlassBottle01a.mdl'
ITEM.SingleUse = true

function ITEM:OnBuy(ply)
	ply:Spawn()
	ply:ChatPrint("You have been brought back from the dead!")
	ply:SetHealth(100)	
	
	timer.simple(5, function()
	ply:SetHealth(100) 
	end)
	
	timer.simple(5, function()
	ply:SetHealth(100) 
	end)
end

I also tried this:


ITEM.Name = 'Respawn'
ITEM.Price = 10000
ITEM.Material = 'models/props_junk/GlassBottle01a.mdl'
ITEM.SingleUse = true

function ITEM:OnBuy(ply)
	ply:Spawn()
	ply:ChatPrint("You have been brought back from the dead!")
	ply:GodEnable()
	
	timer.simple(5, function()
	ply:GodDisable() 
	end)
end

Thanks.

I feel gross doing this… but Bump. ;-; Oh god what have I done…
I just really want this to work. It should be quite simple.

its timer.Simple() - not timer.simple()

ffs… Really?

So basically you should post your lua errors, basically.
Basically next time remember to post it with the error, basically.

sethealth does nothing if your already dead, you need to use ply:Spawn()

He did do ply:Spawn() can you not read?

The ply:Spawn() is in there. The sethealth was supposed to reset your HP after you get out of the AFK killer zones. But the godmode is working. So its obviously the better choice.