Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ENT:Draw()
  2.     if not self.ItemData then
  3.         if POINTSHOP.FindItemByID(self:GetNWString("item_id")) then
  4.             self.ItemData = POINTSHOP.FindItemByID(self:GetNWString("item_id"))
  5.             return
  6.         end
  7.     end
  8.    
  9.     local owner = self:GetOwner()
  10.    
  11.     if owner == LocalPlayer() and GetViewEntity():GetClass() == "player" then return end
  12.    
  13.     if owner and owner:IsValid() and owner:Alive() then
  14.         local attach = owner:GetAttachment(owner:LookupAttachment("eyes"))
  15.         if not attach then attach = owner:GetAttachment(owner:LookupAttachment("head")) end
  16.        
  17.         if attach then
  18.             if self.ItemData then
  19.                 if self.ItemData.Functions and self.ItemData.Functions.ModifyHat then
  20.                     self, attach = self.ItemData.Functions.ModifyHat(self, attach.Pos, attach.Ang)
  21.                 end
  22.                
  23.                 self:SetPos(attach.Pos)
  24.                 self:SetAngles(attach.Ang)
  25.                
  26.                 self:DrawModel()
  27.             end
  28.         end
  29.     end
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement