Force Spawn

any way to make a Force Spawn? sounds easy, like a 10 sec timer and then a ply:Spawn()
ive tried to make one but it keeps failing
help?

[lua]

if CLIENT then return end

if SERVER then

function RespawnWow(ply)
timer.Simple(10, function()
ply:Spawn()
end)
end
hook.Add( “PlayerDeath”, “RespawnWow”, RespawnWow )

end

[/lua]

Put that in a file in garrysmod/lua/autorun

Or
[lua]
function RespawnWow(ply)
timer.Simple(10, function()
ply:Spawn()
end)
end
[/lua]

serverside, sorry no tab :smiley:

How will that work? RespawnWow is not a valid function and you didn’t even hook it.

That does work, sorry, the way he said it made it sound like ply:Spawn() didn’t work.

[lua]

if CLIENT then return end

if SERVER then

function RespawnWow(ply)
timer.Simple(10, function()
ply:Spawn()
end)
end
hook.Add( “PlayerDeath”, “RespawnWow”, RespawnWow )

end

[/lua]

o.o automerge fail

Im sure he can hook it himself so i didnt take the time to do it, it was a quick reply and im fairely busy

Note: you can use pl:Spawn() on players that are alive, so it will bring them back to the spawnpoint. I would check and see if the player is still dead before forcing them to spawn.