Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function S_init(ply)
- ply:SetNWInt("S_Hunger", 1000)
- ply:SetNWInt("S_Thirst", 1000)
- ply:SetNWInt("S_Other", 1000)
- ply:SetNWBool("S_Poisoned", false)
- end
- local function S_Init()
- print(s_log)
- s_log = true
- p_enable = true
- end
- hook.Add( "Initialize", "Simulate_Init", S_Init )
- local function Simulate()
- if s_log then
- hunger = CurTime() + 3 + hunger_speed
- s_log = false
- end
- for k, v in pairs(player.GetAll()) do
- if CurTime() > hunger then
- v:SetNWInt("S_Hunger", v:GetNWInt("S_Hunger") - hunger_food/100*1000)
- v:SetNWInt("S_Thirst", v:GetNWInt("S_Thirst") -hunger_water/100*1000)
- s_log = true
- if v:GetNWInt("S_Hunger") <= 0 or v:GetNWInt("S_Thirst") <= 0 then
- v:SetNWInt("S_Hunger", 0)
- v:SetNWInt("S_Thirst", 0)
- if v:Alive() then
- v:Kill()
- end
- end
- end
- if v:GetNWBool("S_Poisoned") then
- if p_enable then
- P_Simu = CurTime() + 330
- p_enable = false
- end
- if CurTime() > hunger then
- if v:Alive() then
- v:SetHealth(v:Health() - 00.000003)
- if v:Health() < 0 and v:Alive() then
- v:Kill()
- end
- end
- end
- if CurTime() > P_Simu then
- v:SetNWBool("S_Poisoned", false)
- p_enable = true
- end
- end
- end
- end
- hook.Add("Think", "S_Simulate", Simulate)
- hook.Add("Think", "S_HP", poison)
- hook.Add("PlayerInitialSpawn", "STATUS.Init", function(ply)
- S_init(ply)
- end)
- hook.Add("PlayerSpawn", "STATUS.Spawn", function(ply)
- S_init(ply)
- end)
- hook.Add("PlayerDeath", "STATUS.Death", function(ply)
- end)
- hook.Add("PlayerDisconnected", "S_D", function(ply)
- timer.Remove("ID_".. ply:SteamID())
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement