(SWEP) Supposed to get angles but gets userdata?

[lua]shared.lua:447: bad argument #2 to ‘__sub’ (Angle expected, got userdata)[/lua]

Here is the code in the file that I have been trying to figure out what is wrong:

[lua] if self.Owner:KeyPressed(IN_JUMP) then
if self.Owner:GetNWInt(“FATIG_TIRED”) == 1 then
return false

	if not self.Owner:OnGround() then
		if self.Owner.Hanging == false and not self.Weapon:CanGrab() then
			if self.Owner.UsedTimes >= 2 then
				local trace = self.Owner:GetEyeTrace()
				if trace.HitPos:Distance(self.Owner:GetShootPos()) <= 50 then -- Wall-jump using W/A/D
					if self.Owner.HasWallJumped == false then
						if self.Owner:KeyDown(IN_FORWARD) then
							self.Owner:SetNWInt("FATIG_AMOUNT", math.Clamp(self.Owner:GetNWInt("FATIG_AMOUNT") - math.random(6,9), 0, 100))
							if SERVER then
								self.Owner:SetEyeAngles(self.Owner:EyeAngles() - Vector(0, 180, 0)) --Here is the line that's supplying the error.447 is here
								self.Owner:SetLocalVelocity(self.Owner:GetForward() * -375 + Vector(0, 0, 75))

Any help is appreciated.

Which line is 447?

Ill put a comment next to it

##This is possibly wrong##
self.Owner:SetEyeAngles( (self.Owner:EyeAngles()-Vector(0, 180, 0)):Angle() )
[/lua]##This is possibly wrong##

Did you check the wiki?

The angles may be backwards btw

I don’t think you can subtract an angle and a vector anymore…

self.Owner:SetEyeAngles( self.Owner:EyeAngles()-Angle(0, 180, 0) )
[/lua] Maybe?

To be honest… no. But this did work, thank you!

You are subtracting a vector from an angle.

  • Not solved. Derp on my end.

Looks like you can just change Vector(0, 180, 0) to Angle(0, 180, 0)

yeah I noticed that after Panda pointed it out, and it worked. Thanks.