mattjeanes

AdvCore3 Example

Oct 31st, 2012
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. -- Made with Dr. Matt's Advanced Base Core v3
  2. ENT.Base            = "advbase_core3"
  3. ENT.PrintName       = "Pony Core" -- The name the Core will come up as in the Spawnmenu
  4. ENT.Spawnable       = true -- If true, Anyone can spawn the entity
  5. ENT.AdminSpawnable  = true -- If true, Admins can spawn the entity, Set ENT.Spawnable to false to make the Core Admin only.
  6. ENT.Author          = "Dr. Matt" -- Self Explanatory, The author of the addon, AKA Your name.
  7. ENT.Contact         = "Facepunch (MattJeanes)" -- Your contact, Perhaps an email address or a Steam username
  8. ENT.Purpose         = "" -- The purpose of the entity
  9. ENT.Instructions    = "Ponies 4 Bronies" -- The instructions of the entity, Perhaps "Insert 1 chocolate cookie to activate."
  10. ENT.AutomaticFrameAdvance = true
  11. ENT.Category        = "Portal 2 Cores" -- The in-game category of the core
  12. ENT.Animation       = "sphere_idle_neutral" -- Set's the animation of the core, Look in Portal 2 Authoring Tools for more info.
  13. ENT.Delay           = 5
  14. ENT.Dir             = "ponies" -- The name of your sub-folder, sounds go in there!
  15. ENT.ModelPath       = "models/cores/pony/core.mdl" -- The exact path to the model, equivalent to self.Entity:SetModel( )
  16. ENT.AnimSpeed       = 0.25  -- Equivalent to self.Entity:SetPlaybackRate( )
  17. ENT.Skin            = 1 -- Equivalent to self.Entity:SetSkin( )
  18. /*---------------------------------------------------------
  19.     ENT.Dir: Put your stuff in the following folders:
  20.    
  21.     sound/cores/(ENT.Dir)/
  22.     sound/cores/(ENT.Dir)/special/ -- For use.wav, undo.wav and dmg.wav
  23.  
  24. ---------------------------------------------------------*/
  25.  
  26. function ENT:CustomInitialize(self)
  27.     -- This function is ran at the end of ENT:Initialize() in the base core, include custom code in here. :)
  28. end
  29.  
  30.  
  31. function ENT:SpawnFunction( ply, tr )
  32.  
  33.     if ( !tr.Hit ) then return end
  34.    
  35.     local SpawnPos = tr.HitPos + tr.HitNormal * 16
  36.    
  37.     local ent = ents.Create( ClassName )
  38.     ent:SetPos( SpawnPos )
  39.     ent:Spawn()
  40.     ent:Activate()
  41.    
  42.     return ent
  43.    
  44. end
Advertisement
Add Comment
Please, Sign In to add comment