Guest User

Untitled

a guest
Feb 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. function RespawnHook()
  2. if not(LocalPlayer() and LocalPlayer():IsValid()) then return end
  3. // If you are not active and valid, then stop the code
  4.     if LocalPlayer():Alive() == false then // If you are not alive then
  5.         timer.Simple(1, function() RunConsoleCommand('+attack') end)
  6.         // Wait 1 second, then run attack which respawns you. We wait 1 second          //because most servers have a spawn delay.
  7.  
  8.         timer.Simple(1.1, function() RunConsoleCommand("-attack") end)
  9.         // Now stop the +attack function so that you can use it again without           // having to click it or type -attack in console.
  10.     end
  11. end
  12. hook.Add("Think", "Respawn", RespawnHook)
Add Comment
Please, Sign In to add comment