Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ENT = {}
- ENT.Type = "anim"
- ENT.Base = "base_entity"
- ENT.Model = Model("")
- ENT.ClassName = ""
- if CLIENT then
- function ENT:Draw()
- self:DrawModel()
- end
- else
- function ENT:Initialize()
- self:SetModel( self.Model )
- self:PhysicsInit( SOLID_VPHYSICS )
- self:SetMoveType( MOVETYPE_VPHYSICS )
- self:SetSolid( SOLID_VPHYSICS )
- self:PhysWake()
- end
- end
- scripted_ents.Register(ENT, ENT.ClassName, true)
- for key, entity in pairs(ents.FindByClass(ENT.ClassName)) do
- table.Merge(entity:GetTable(), ENT)
- entity:Initialize()
- end
- if SERVER then
- if #ents.FindByClass(ENT.ClassName) > 0 then return end
- local player = nero.GetPlayer("caps") --<<<<<<<<<<<<<<<<<<<<<<<< your name here!
- local trace = player:GetEyeTrace()
- local entity = ents.Create(ENT.ClassName)
- entity:Spawn()
- entity:SetPos(trace.HitPos + Vector(0,0,entity:BoundingRadius()))
- entity:DropToFloor()
- undo.Create(class)
- undo.SetPlayer(player)
- undo.AddEntity(entity)
- undo.Finish()
- end
Add Comment
Please, Sign In to add comment