add sborka
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/props_combine/health_charger001.mdl")
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
|
||||
local phys = self:GetPhysicsObject()
|
||||
if phys:IsValid() then
|
||||
phys:Wake()
|
||||
end
|
||||
|
||||
self:SetHealth(100)
|
||||
self.MaxHealth = 100
|
||||
end
|
||||
|
||||
function ENT:Use(activator, caller)
|
||||
if activator:IsPlayer() then
|
||||
if activator:Health() < activator:GetMaxHealth() then
|
||||
activator:SetHealth(math.min(activator:Health() + 25, activator:GetMaxHealth()))
|
||||
end
|
||||
|
||||
if activator.IsBleeding then
|
||||
activator:StopBleeding()
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
ENT.Type = "anim"
|
||||
ENT.Base = "base_gmodentity"
|
||||
|
||||
ENT.PrintName = "Health Station"
|
||||
ENT.Author = "aboba"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
Reference in New Issue
Block a user