Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1.  
  2. function S_init(ply)
  3. ply:SetNWInt("S_Hunger", 1000)
  4. ply:SetNWInt("S_Thirst", 1000)
  5. ply:SetNWInt("S_Other", 1000)
  6. ply:SetNWBool("S_Poisoned", false)
  7. end
  8.  
  9. local function S_Init()
  10. print(s_log)
  11. s_log = true
  12. p_enable = true
  13. end
  14. hook.Add( "Initialize", "Simulate_Init", S_Init )
  15.  
  16. local function Simulate()
  17. if s_log then
  18. hunger = CurTime() + 3 + hunger_speed
  19. s_log = false
  20. end
  21. for k, v in pairs(player.GetAll()) do
  22. if CurTime() > hunger then
  23. v:SetNWInt("S_Hunger", v:GetNWInt("S_Hunger") - hunger_food/100*1000)
  24. v:SetNWInt("S_Thirst", v:GetNWInt("S_Thirst") -hunger_water/100*1000)
  25. s_log = true
  26. if v:GetNWInt("S_Hunger") <= 0 or v:GetNWInt("S_Thirst") <= 0 then
  27. v:SetNWInt("S_Hunger", 0)
  28. v:SetNWInt("S_Thirst", 0)
  29. if v:Alive() then
  30. v:Kill()
  31. end
  32. end
  33. end
  34.  
  35. if v:GetNWBool("S_Poisoned") then
  36. if p_enable then
  37. P_Simu = CurTime() + 330
  38. p_enable = false
  39. end
  40. if CurTime() > hunger then
  41. if v:Alive() then
  42. v:SetHealth(v:Health() - 00.000003)
  43. if v:Health() < 0 and v:Alive() then
  44. v:Kill()
  45. end
  46. end
  47.  
  48. end
  49. if CurTime() > P_Simu then
  50. v:SetNWBool("S_Poisoned", false)
  51. p_enable = true
  52. end
  53. end
  54. end
  55.  
  56.  
  57.  
  58. end
  59. hook.Add("Think", "S_Simulate", Simulate)
  60.  
  61. hook.Add("Think", "S_HP", poison)
  62. hook.Add("PlayerInitialSpawn", "STATUS.Init", function(ply)
  63. S_init(ply)
  64. end)
  65. hook.Add("PlayerSpawn", "STATUS.Spawn", function(ply)
  66. S_init(ply)
  67. end)
  68. hook.Add("PlayerDeath", "STATUS.Death", function(ply)
  69.  
  70. end)
  71.  
  72. hook.Add("PlayerDisconnected", "S_D", function(ply)
  73. timer.Remove("ID_".. ply:SteamID())
  74. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement