Guest User

Untitled

a guest
Feb 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. function RespawnHook()
  2. if not(LocalPlayer() and LocalPlayer():IsValid()) then return end // If you are not active and valid, then stop the code
  3.     if LocalPlayer():Alive() == false then // If you are not alive then
  4.         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.
  5.         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.
  6.     end
  7. end
  8. hook.Add("Think", "Respawn", RespawnHook)
Add Comment
Please, Sign In to add comment