CapsAdmin

Untitled

Jan 16th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. local outfit = {
  2. -- start of outfit.txt
  3.     [1] = {
  4.     ["children"] = {
  5.         [1] = {
  6.             ["children"] = {
  7.                 [1] = {
  8.                     ["children"] = {
  9.                     },
  10.                     ["self"] = {
  11.                         ["ClassName"] = "proxy",
  12.                         ["UniqueID"] = "3120004463",
  13.                         ["Expression"] = "hsv_to_color(time()*100)",
  14.                         ["GlobalID"] = "4180875644",
  15.                         ["VariableName"] = "Color",
  16.                     },
  17.                 },
  18.             },
  19.             ["self"] = {
  20.                 ["UniqueID"] = "884479784",
  21.                 ["GlobalID"] = "1864536752",
  22.                 ["Position"] = Vector(0, 0, 28),
  23.                 ["Size"] = 2.175,
  24.                 ["Color"] = Vector(255, 12, 0),
  25.                 ["EditorExpand"] = true,
  26.                 ["Model"] = "models/pac/default.mdl",
  27.                 ["ClassName"] = "model",
  28.                 ["Name"] = "ball",
  29.             },
  30.         },
  31.     },
  32.     ["self"] = {
  33.         ["ClassName"] = "group",
  34.         ["OwnerName"] = "self",
  35.         ["EditorExpand"] = true,
  36.         ["GlobalID"] = "3872319760",
  37.         ["UniqueID"] = "3296086797",
  38.         ["Name"] = "my outfit",
  39.         ["Description"] = "add parts to me!",
  40.     },
  41. },
  42. -- end of outfit.txt
  43. }
  44.  
  45. local ENT = {}
  46.  
  47. ENT.Base = "base_anim"
  48. ENT.Type = "anim"
  49.  
  50. ENT.ClassName = "pac_test"
  51.  
  52. if CLIENT then
  53.     pac.SetupENT(ENT)
  54.    
  55.     function ENT:Draw()
  56.         self:DrawModel()
  57.     end
  58.    
  59.     function ENT:Think()
  60.         -- manipualte it here!
  61.         if self.ball then
  62.             self.ball:SetSize(2 + math.sin(RealTime()))
  63.         end
  64.     end
  65.    
  66.     function ENT:Initialize()
  67.         self:AttachPACPart(outfit)
  68.        
  69.         -- find the ball part
  70.         self.ball = self:FindPACPart(outfit, "ball")       
  71.     end
  72.    
  73.     function ENT:OnRemove()
  74.         self:RemovePACPart(outfit) 
  75.     end
  76. end
  77.  
  78. if SERVER then
  79.     function ENT:Initialize()
  80.         self:SetModel("models/props_borealis/bluebarrel001.mdl")
  81.         self:PhysicsInit(SOLID_VPHYSICS)
  82.         self:SetMoveType(MOVETYPE_NONE)
  83.     end
  84. end
  85.  
  86. scripted_ents.Register(ENT, ENT.ClassName)
Advertisement
Add Comment
Please, Sign In to add comment