pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

Lua paste-bin - collaborative debugging tool View Help


Posted by Anonymous on Tue 16th Jan 17:42 (modification of post by Anonymous view diff)
diff | download | new post

  1.  
  2.  
  3. ENT.Type = "anim"
  4.  
  5. ENT.PrintName      = ""
  6. ENT.Author                  = ""
  7. ENT.Contact               = ""
  8. ENT.Purpose               = ""
  9. ENT.Instructions        = ""
  10.  
  11. function ENT:TrackEntity( ent )
  12.  
  13.         if ( !ent || !ent:IsValid() ) then return end
  14.        
  15.         local WPos = ent:GetPos()
  16.         WPos.y = 0;
  17.         WPos = WPos + Vector( 0, 0, 400 )
  18.  
  19.         if (self.Entity:GetPos() - WPos):Length() > 400 then        self.Entity:SetPos(WPos)    Msg("to far away!\n")       end
  20.        
  21.         local v = ent:GetVelocity()
  22.         v.y = 0
  23.        
  24.         local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, WPos.z)
  25.  
  26.         if (v.z == 0) then
  27.                 self.Entity:SetPos( adjustVec )
  28.         end
  29.        
  30.         if (SERVER) then
  31.                 self.Entity:SetLocalVelocity( v )
  32.         end
  33.        
  34.         local Ang = ent:GetPos() - WPos
  35.         Ang = Ang:Angle()
  36. Ang.Pitch = 0
  37.         self.Entity:SetAngles(Ang)
  38.  
  39. end

Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Use syntax highlighting

To highlight particular lines, prefix each line with @@


Remember my settings