dobrograd-13-06-2022/garrysmod/addons/feature-drugs/lua/entities/durgz_mushroom/init.lua
Jonny_Bro (Nikita) e4d5311906 first commit
2023-11-16 15:01:19 +05:00

37 lines
1,012 B
Lua

AddCSLuaFile("shared.lua")
include("shared.lua")
ENT.MODEL = "models/ipha/mushroom_small.mdl"
ENT.MASS = 55;
ENT.LASTINGEFFECT = 60; --how long the high lasts in seconds
--called when you use it (after it sets the high visual values and removes itself already)
function ENT:High(activator,caller)
if (math.random(0, 22) == 0) then
activator:Ignite(5, 0)
self:Say(activator, "FFFFFFUUUUUUUUUUUUUUUUUU")
else
local health = activator:Health()
if (health * 3 / 2 < 500) then
activator:SetHealth (math.floor(health - 5))
else
activator:SetHealth(health - 5)
end
-- activator:SetGravity(0.135);
self:Say(activator, "what")
end
end
function ENT:AfterHigh(activator, caller)
end
-- local function ResetGrav()
-- for id, pl in pairs(player.GetAll()) do
-- if (pl:GetNetVar("durgz_mushroom_high_end") - 0.5 < CurTime() && pl:GetNetVar("durgz_mushroom_high_end") > CurTime() )then
-- pl:SetGravity(1)
-- end
-- end
-- end
-- hook.Add("Think", "durgz_mushroom_resetgrav", ResetGrav)