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

31 lines
660 B
Lua

AddCSLuaFile( "shared.lua" )
AddCSLuaFile( "cl_init.lua" )
include( "shared.lua" )
function ENT:SpawnFunction( ply, tr )
if !tr.Hit then return end
local SpawnPos = tr.HitPos + tr.HitNormal * 1
local ent = ents.Create( "brax_atm" )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
return ent
end
function ENT:Initialize()
self.BreakOpenHealthMax = 10
self.BreakOpenHealth = 10
self.BreakOpenBroken = false
self:SetModel("models/props_unique/atm01.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
end