Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local hook = hook;
- local Angle = Angle;
- local Vector = Vector;
- local fa;
- local math = math;
- local CreateClientConVar = CreateClientConVar;
- local var = CreateClientConVar("spinbot", 0);
- local speed = CreateClientConVar("spinbot_speed", 4);
- local function FixMovement(ucmd)
- local move = Vector(ucmd:GetForwardMove(), ucmd:GetSideMove(), 0);
- local move = (move:Angle() + ( ucmd:GetViewAngles() - fa ) ):Forward() * move:Length();
- ucmd:SetForwardMove(move.x);
- ucmd:SetSideMove(move.y);
- end
- hook.Add("CalcView", "", function(p, o, a, f)
- local view = {};
- view.fov = f;
- view.origin = o;
- view.angles = fa;
- return view;
- end);
- hook.Add("CreateMove", "", function(ucmd)
- if (!fa) then fa = ucmd:GetViewAngles(); end
- fa = (fa + Angle(ucmd:GetMouseY() * .023, ucmd:GetMouseX() * -.023, 0));
- fa.p, fa.y, fa.x = math.Clamp(fa.p, -89, 89), math.NormalizeAngle(fa.y), math.NormalizeAngle(fa.x);
- if(ucmd:KeyDown(1) || var:GetInt() != 1) then
- ucmd:SetViewAngles(fa);
- return;
- end
- ucmd:SetViewAngles(ucmd:GetViewAngles() + Angle(0, speed:GetInt(), 0));
- FixMovement(ucmd);
- end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement