Python1320

Untitled

Dec 9th, 2010
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. local me = nero.GetPlayer"NEJ@T KILLER M@CHINE"
  2. local ENT = {}
  3.  
  4. ENT.Type = "anim"
  5. ENT.Base = "base_entity"
  6.  
  7. ENT.Model = Model("")
  8. ENT.ClassName = ""
  9.  
  10. if CLIENT then
  11.  
  12.     function ENT:Draw()
  13.         self:DrawModel()
  14.     end
  15.  
  16. else
  17.     function ENT:Initialize()
  18.         self:SetModel( self.Model )
  19.         self:PhysicsInit( SOLID_VPHYSICS )
  20.         self:SetMoveType( MOVETYPE_VPHYSICS )
  21.         self:SetSolid( SOLID_VPHYSICS )
  22.         self:PhysWake()
  23.     end
  24. end
  25.  
  26. scripted_ents.Register(ENT, ENT.ClassName, true)
  27.  
  28. for key, entity in pairs(ents.FindByClass(ENT.ClassName)) do
  29.     table.Merge(entity:GetTable(), ENT)
  30.     entity:Initialize()
  31. end
  32.  
  33. if SERVER then
  34.     if #ents.FindByClass(ENT.ClassName) > 0 then return end
  35.  
  36.     local trace = me:GetEyeTrace()
  37.     local entity = ents.Create(ENT.ClassName)
  38.     entity:Spawn()
  39.     entity:SetPos(trace.HitPos + Vector(0,0,entity:BoundingRadius()))
  40.     entity:DropToFloor()
  41.    
  42.     undo.Create(class)
  43.         undo.SetPlayer(me)
  44.         undo.AddEntity(entity)
  45.     undo.Finish()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment