Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function RespawnHook()
- if not(LocalPlayer() and LocalPlayer():IsValid()) then return end
- // If you are not active and valid, then stop the code
- if LocalPlayer():Alive() == false then // If you are not alive then
- timer.Simple(1, function() RunConsoleCommand('+attack') end)
- // Wait 1 second, then run attack which respawns you. We wait 1 second //because most servers have a spawn delay.
- timer.Simple(1.1, function() RunConsoleCommand("-attack") end)
- // Now stop the +attack function so that you can use it again without // having to click it or type -attack in console.
- end
- end
- hook.Add("Think", "Respawn", RespawnHook)
Add Comment
Please, Sign In to add comment