Finding the Angle Between 2 Vectors

So I took a look at the wiki to see if I could get the angle between two points in order to make a chain lightning gun. Unfortunately, there is no proper function for it, and the only advice is to take the inverse cosine of the dot product divided by the product of the magnitudes. I tried this, and instead of working as should and jumping to a random target, the lightning flies off in some random direction.

Is there any better way to locate the angle?

[lua]
// get the direction
local vec = ( pointA - pointB ):Normalize();
// convert the vector to an angle
local ang = vec:Angle();
[/lua]