[LUA] Better AutoStrafer

Posts 1–3 of 3 · Page 1 of 1
[LUA] Better AutoStrafer
showcase: https://streamable.com/nmng24

autostrafer that automatically gain speed
have fun, it probably won't work correctly with antiaim or silent aimbot

 
code
Code:
local origAngle = Angle(0,0,0)
hook.Add("CreateMove","betterAutoStrafe",function(ucmd)
    if(!IsValid(LocalPlayer())) then return end
    if (!origAngle) then origAngle = ucmd:GetViewAngles() end
    origAngle = (origAngle + Angle(ucmd:GetMouseY() * 0.023, ucmd:GetMouseX() * -0.023, 0))
    origAngle.p, origAngle.y, origAngle.x = math.Clamp(origAngle.p, -89, 89), math.NormalizeAngle(origAngle.y), math.NormalizeAngle(origAngle.x)

    if(ucmd:CommandNumber() == 0) then
        ucmd:SetViewAngles(origAngle)
        return
    end
    if(!input.IsKeyDown(KEY_SPACE) or LocalPlayer():IsOnGround()) then return end
    ucmd:RemoveKey(IN_JUMP)
    if(engine.TickCount() % 2 == 0) then
        ucmd:SetSideMove(10000)
        ucmd:SetViewAngles(LerpAngle(0.6,ucmd:GetViewAngle  s(),Angle(0,origAngle.y + 3,0)))
    else
        ucmd:SetSideMove(-10000)
        ucmd:SetViewAngles(LerpAngle(0.6,ucmd:GetViewAngle  s(),Angle(0,origAngle.y - 3,0)))
    end
end)
Hello, I tried to use this but it gives an error.

[ERROR] lua/gmodbh.lua:16: function arguments expected near 's'
Quote Originally Posted by patatescimamut View Post
Hello, I tried to use this but it gives an error.

[ERROR] lua/gmodbh.lua:16: function arguments expected near 's'
Code:
local origAngle = Angle(0,0,0)
hook.Add("CreateMove","betterAutoStrafe",function(ucmd)
    if(!IsValid(LocalPlayer())) then return end
    if (!origAngle) then origAngle = ucmd:GetViewAngles() end
    origAngle = (origAngle + Angle(ucmd:GetMouseY() * 0.023, ucmd:GetMouseX() * -0.023, 0))
    origAngle.p, origAngle.y, origAngle.x = math.Clamp(origAngle.p, -89, 89), math.NormalizeAngle(origAngle.y), math.NormalizeAngle(origAngle.x)

    if(ucmd:CommandNumber() == 0) then
        ucmd:SetViewAngles(origAngle)
        return
    end
    if(!input.IsKeyDown(KEY_SPACE) or LocalPlayer():IsOnGround()) then return end
    ucmd:RemoveKey(IN_JUMP)
    if(engine.TickCount() % 2 == 0) then
        ucmd:SetSideMove(10000)
        ucmd:SetViewAngles(LerpAngle(0.6,ucmd:GetViewAngles(),Angle(0,origAngle.y + 3,0)))
    else
        ucmd:SetSideMove(-10000)
        ucmd:SetViewAngles(LerpAngle(0.6,ucmd:GetViewAngles(),Angle(0,origAngle.y - 3,0)))
    end
end)
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us