I’ve been trying to create a SWEP that will allow me to push or pull and object towards the user when the user is aiming at something, and if he isn’t, push or pull in the direction the user is facing. So far, I’ve come up with is:
if ( !self:CanPrimaryAttack() ) or (self.Weapon:Clip1() < 5) then return end
self.Owner:SetVelocity(self.Owner:GetVelocity() + self.Owner:GetAimVector()) self:TakePrimaryAmmo(5)
I’ve tested that, and, if I’m on the ground, nothing happens, but if I’m in the air, it makes me go off in odd directions. Can anyone please put me in the right direction?
Thanks in advance!