Posted by Anonymous on Tue 16th Jan 17:11
download | new post
- function ENT:TrackEntity( ent )
- if ( !ent || !ent:IsValid() ) then return end
- local WPos = ent:GetPos()
- WPos.y = 64;
- WPos = WPos + Vector( 20, 0, 100 )
- if (self.Entity:GetPos() - WPos):Length() > 400 then self.Entity:SetPos(WPos) Msg("to far away!\n") end
- local v = ent:GetVelocity()
- v.y = 0
- local adjustVec = Vector(self.Entity:GetPos().x, self.Entity:GetPos().y, WPos.z)
- if (v.z == 0) then
- self.Entity:SetPos( adjustVec )
- end
- if (SERVER) then
- self.Entity:SetLocalVelocity( v )
- end
- local Ang = ent:GetPos() - WPos
- Ang = Ang:Angle()
- Ang.Pitch = 0
- self.Entity:SetAngles(Ang)
- 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.