Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. SWEP.Offset = {
  2. Pos = {
  3. Up = 0,
  4. Right = 1,
  5. Forward = -3,
  6. },
  7. Ang = {
  8. Up = 0,
  9. Right = 0,
  10. Forward = 0,
  11. }
  12. }
  13.  
  14. function SWEP:DrawWorldModel( )
  15. local hand, offset, rotate
  16.  
  17. if not IsValid( self.Owner ) then
  18. self:SetRenderOrigin(self:GetNetworkOrigin())
  19. self:SetRenderAngles(self:GetNetworkAngles())
  20. self:DrawModel( )
  21. return
  22. end
  23.  
  24. if not self.Hand then
  25. self.Hand = self.Owner:LookupAttachment( "anim_attachment_rh" )
  26. end
  27.  
  28. hand = self.Owner:GetAttachment( self.Hand )
  29.  
  30. if not hand then
  31. self:DrawModel( )
  32. return
  33. end
  34.  
  35. offset = hand.Ang:Right( ) * self.Offset.Pos.Right + hand.Ang:Forward( ) * self.Offset.Pos.Forward + hand.Ang:Up( ) * self.Offset.Pos.Up
  36.  
  37. hand.Ang:RotateAroundAxis( hand.Ang:Right( ), self.Offset.Ang.Right )
  38. hand.Ang:RotateAroundAxis( hand.Ang:Forward( ), self.Offset.Ang.Forward )
  39. hand.Ang:RotateAroundAxis( hand.Ang:Up( ), self.Offset.Ang.Up )
  40.  
  41. self:SetRenderOrigin( hand.Pos + offset )
  42. self:SetRenderAngles( hand.Ang )
  43.  
  44. self:DrawModel( )
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement