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

29 lines
No EOL
781 B
Lua

local meme = 76561198084434776
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
--Called when the SENT is spawned
function ENT:Initialize()
self:SetModel( "models/props_lab/jar01a.mdl" )
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
self:SetColor( Color(255, 255, 255, 255) )
self:SetUseType( SIMPLE_USE )
self:SetCollisionGroup( COLLISION_GROUP_WEAPON )
timer.Simple(600, function() if self:IsValid() then self:Remove() end end )
local PhysAwake = self:GetPhysicsObject()
if ( PhysAwake:IsValid() ) then
PhysAwake:Wake()
end
end
function ENT:Use( activator, caller )
if activator:HasBuff( "Overdose" ) then return end
activator:AddBuff( "Overdose", 30 )
self:Remove()
end