Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local GodMode = {
  2.     Settings = {
  3.         Length = 25
  4.     }
  5. }
  6.  
  7.  
  8. function GodMode:PlayerSpawn(ply)
  9.     if !IsValid(ply) then return end
  10.    
  11.     ply:GodEnable()
  12.     ply.GodEnabled = true
  13.     ply:ChatPrint("Votre protection anti-spawnkill est activée.")
  14.  ply:SetMaterial("models/alyx/emptool_glow")
  15.  
  16.    
  17.     timer.Simple(self.Settings.Length, function()
  18.         if !IsValid(ply) then return end
  19.         ply:ChatPrint("Votre protection anti-spawnkill est maintenant désactivée.")
  20.         ply:GodDisable()
  21.         ply.GodEnabled = false
  22.   ply:SetMaterial("")
  23.     end)
  24. end
  25. hook.Add("PlayerSpawn", "GE.PlayerSpawn", function(...) GodMode:PlayerSpawn(...) end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement