Results 1 to 3 of 3
  1. #1
    chrabonszcz's Avatar
    Join Date
    May 2018
    Gender
    male
    Posts
    6
    Reputation
    10
    Thanks
    1
    My Mood
    Asleep

    [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:
    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)

  2. The Following User Says Thank You to chrabonszcz For This Useful Post:

    WhyDoIHaveToSignUp12 (04-24-2021)

  3. #2
    patatescimamut's Avatar
    Join Date
    Jul 2018
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    0
    Hello, I tried to use this but it gives an error.

    [ERROR] lua/gmodbh.lua:16: function arguments expected near 's'

  4. #3
    Ayahoo's Avatar
    Join Date
    Jan 2021
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    0
    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)

Similar Threads

  1. [Help Request] spoonfeed 1tick autostrafer in lua pls?
    By imnotcool in forum Garry's Mod Coding & Resources
    Replies: 0
    Last Post: 07-04-2019, 06:45 PM
  2. [Outdated] How to get memory usage in lua [Better than using gcinfo()]
    By OJthejuiceman in forum Garry's Mod Hacks & Cheats
    Replies: 22
    Last Post: 10-16-2015, 05:05 PM
  3. Which sig looks better
    By Killclowns in forum Art & Graphic Design
    Replies: 5
    Last Post: 02-10-2006, 07:13 AM
  4. What do ya like better?
    By i eat trees in forum Entertainment
    Replies: 5
    Last Post: 02-09-2006, 10:57 PM
  5. 2nd sig much better!
    By darkone1149 in forum Art & Graphic Design
    Replies: 5
    Last Post: 02-08-2006, 05:15 PM