Alright guys, first off, no this is not for an aimbot, it is for an zombie based RPG mod I'm working on, the actual use of it inside the client is to aim a "breakouts", truthfully I'm just making the mod based purely on my own knowledge gain and fun.
It will not be released.
I've tested a few things from resources and implicated my own ideas/thoughts into a function that when given a Position in coordinates will cause the player to aim at that location.
However with the current script it causes the player to look in the same direction every time, no matter what.
function Aim(%pos)
{
if(%pos != 0)
{
%player = serverConnection.getControlObject();
%fv = %player.getMuzzleVector(0);
%x = getWord(%fv,0);
%y = getWord(%fv,1);
%vv = vectorNormalize(vectorSub(%pos,%player.getPosition()));
%xx = getWord(%vv,0);
%yy = getWord(%vv,1);
$mvYaw = mATan(%xx,%yy)-mATan(%x,%y);
$mvPitch = mATan(getWord(%fv,2),mSqrt(%x*%x+%y*%y))-mATan(getWord(%vv,2),mSqrt(%xx*%xx+%yy*%yy));
}
}
Any ideas?