Bad argument #1 to '__add' (angle expected, got userdata)

Hi there.

I’m currently fixing leeroy’s reload anim mod, but i’m having problems.

The one thing i cant fix, is this error:

[lua]
[ERROR] lua/autorun/reloadanim_view.lua:59: bad argument #2 to ‘__add’ (Angle expected, got userdata)

  1. __add - [C]:-1
  2. fn - lua/autorun/reloadanim_view.lua:59
    3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
    [/lua]

Here’s the line thats causing this error:

[lua]
local AttPos, AttAng = CurrentAttachment.Pos, CurrentAttachment.Ang + ply:GetAimVector()
[/lua]

Here’s the whole code i have:

I’ve looked everywhere, including the changes list, but i cant find anything.

Can anyone shine some light on this?

Hmm, if I’m not wrong Angles have to be structured like Angle( bleh, bleh, bleh) similar to Vector(blehblehbleh)



local AttPos, AttAng = CurrentAttachment.Pos, CurrentAttachment.Ang + ply:GetAimVector()


try that and tell me how it turned out

GetAimVector returns a vector, not an angle.

What are you trying to do exactly?

Oh yeah, buu should probably use something like ply:EyeAngles() or something.

Anything that’s an angle table should be fine, sure.

Thanks guys.
EyeAngles() worked perfectly.