Bhop & Strafe Script

Posts 1–15 of 16 · Page 1 of 2
Bhop & Strafe Script
Hi folks,
Here is the Source to the Bunny Hopping and strafing script I have made.
Code:
local bhop_cv = CreateClientConVar("bocui_bhop", 0);
local auto_cv = CreateClientConVar("bocui_strafe", 0);
 
local FW = true; -- forward
local BW = false; -- backwards
local NONE = nil; -- neither
 
local cd = 6; -- cooldown
local ccd = 0; -- current cooldown
local lastc = 0; -- last cmd number
local lp = LocalPlayer(); -- localplayer
 
local function FWorBW(vel, ang)
        local a = vel;
        a:Rotate(-ang)
        if(a.x > 0) then
                return FW;
        elseif(a.x < 0) then
                return BW;
        end
        return NONE
end
 
local function bhopper(cmd)
        if(lp:GetMoveType() == MOVETYPE_NOCLIP or lp:WaterLevel() >= 2) then return; end --does it make sense to jump?  -- noclip src 12
        if (cmd:KeyDown(IN_JUMP)) then
                if(auto_cv:GetBool()) then
                        local mul = FWorBW(lp:GetVelocity(), lp:EyeAngles()) == BW and -1 or 1;
                        if(cmd:GetMouseX() < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = -cd;
                        elseif(cmd:GetMouseX() > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = cd;
                        elseif(ccd < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = ccd + 1;
                        elseif(ccd > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = ccd - 1;
                        end
                end
                if (lp:OnGround() and cmd:CommandNumber() ~= lastc + 1) then
                        cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_JUMP));
                        if(cmd:CommandNumber() ~= 0) then lastc = cmd:CommandNumber(); end
                        return;
                end
        end
        cmd:RemoveKey(IN_JUMP);
end
 
 
-- preperation
hook.Remove("CreateMove", "bunnyhop");
if(bhop_cv:GetBool()) then
        hook.Add("CreateMove", "bunnyhop", bhopper);
end
-- end of prep
 
 
cvars.AddChangeCallback("bocui_bhop", function()
        if(bhop_cv:GetBool()) then
                hook.Add("CreateMove", "bunnyhop", bhopper);
        else
                hook.Remove("CreateMove", "bunnyhop");
        end
end)
 
MsgC(Color(0,255,0), "\nBocui Bhop initialized!\n");
Quote Originally Posted by SaganTM View Post
Hi folks,
Here is the Source to the Bunny Hopping and strafing script I have made.
Code:
local bhop_cv = CreateClientConVar("bocui_bhop", 0);
local auto_cv = CreateClientConVar("bocui_strafe", 0);
 
local FW = true; -- forward
local BW = false; -- backwards
local NONE = nil; -- neither
 
local cd = 6; -- cooldown
local ccd = 0; -- current cooldown
local lastc = 0; -- last cmd number
local lp = LocalPlayer(); -- localplayer
 
local function FWorBW(vel, ang)
        local a = vel;
        a:Rotate(-ang)
        if(a.x > 0) then
                return FW;
        elseif(a.x < 0) then
                return BW;
        end
        return NONE
end
 
local function bhopper(cmd)
        if(lp:GetMoveType() == MOVETYPE_NOCLIP or lp:WaterLevel() >= 2) then return; end --does it make sense to jump?  -- noclip src 12
        if (cmd:KeyDown(IN_JUMP)) then
                if(auto_cv:GetBool()) then
                        local mul = FWorBW(lp:GetVelocity(), lp:EyeAngles()) == BW and -1 or 1;
                        if(cmd:GetMouseX() < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = -cd;
                        elseif(cmd:GetMouseX() > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = cd;
                        elseif(ccd < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = ccd + 1;
                        elseif(ccd > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = ccd - 1;
                        end
                end
                if (lp:OnGround() and cmd:CommandNumber() ~= lastc + 1) then
                        cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_JUMP));
                        if(cmd:CommandNumber() ~= 0) then lastc = cmd:CommandNumber(); end
                        return;
                end
        end
        cmd:RemoveKey(IN_JUMP);
end
 
 
-- preperation
hook.Remove("CreateMove", "bunnyhop");
if(bhop_cv:GetBool()) then
        hook.Add("CreateMove", "bunnyhop", bhopper);
end
-- end of prep
 
 
cvars.AddChangeCallback("bocui_bhop", function()
        if(bhop_cv:GetBool()) then
                hook.Add("CreateMove", "bunnyhop", bhopper);
        else
                hook.Remove("CreateMove", "bunnyhop");
        end
end)
 
MsgC(Color(0,255,0), "\nBocui Bhop initialized!\n");
skid
/2shrt
Thank You For This Soruce CodE Man
Quote Originally Posted by SaganTM View Post
Hi folks,
Here is the Source to the Bunny Hopping and strafing script I have made.
Code:
local bhop_cv = CreateClientConVar("bocui_bhop", 0);
local auto_cv = CreateClientConVar("bocui_strafe", 0);
 
local FW = true; -- forward
local BW = false; -- backwards
local NONE = nil; -- neither
 
local cd = 6; -- cooldown
local ccd = 0; -- current cooldown
local lastc = 0; -- last cmd number
local lp = LocalPlayer(); -- localplayer
 
local function FWorBW(vel, ang)
        local a = vel;
        a:Rotate(-ang)
        if(a.x > 0) then
                return FW;
        elseif(a.x < 0) then
                return BW;
        end
        return NONE
end
 
local function bhopper(cmd)
        if(lp:GetMoveType() == MOVETYPE_NOCLIP or lp:WaterLevel() >= 2) then return; end --does it make sense to jump?  -- noclip src 12
        if (cmd:KeyDown(IN_JUMP)) then
                if(auto_cv:GetBool()) then
                        local mul = FWorBW(lp:GetVelocity(), lp:EyeAngles()) == BW and -1 or 1;
                        if(cmd:GetMouseX() < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = -cd;
                        elseif(cmd:GetMouseX() > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = cd;
                        elseif(ccd < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = ccd + 1;
                        elseif(ccd > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = ccd - 1;
                        end
                end
                if (lp:OnGround() and cmd:CommandNumber() ~= lastc + 1) then
                        cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_JUMP));
                        if(cmd:CommandNumber() ~= 0) then lastc = cmd:CommandNumber(); end
                        return;
                end
        end
        cmd:RemoveKey(IN_JUMP);
end
 
 
-- preperation
hook.Remove("CreateMove", "bunnyhop");
if(bhop_cv:GetBool()) then
        hook.Add("CreateMove", "bunnyhop", bhopper);
end
-- end of prep
 
 
cvars.AddChangeCallback("bocui_bhop", function()
        if(bhop_cv:GetBool()) then
                hook.Add("CreateMove", "bunnyhop", bhopper);
        else
                hook.Remove("CreateMove", "bunnyhop");
        end
end)
 
MsgC(Color(0,255,0), "\nBocui Bhop initialized!\n");
nice paste from lenny skripts dude
Quote Originally Posted by LennyPenny View Post
what a loseR
HE'S ALIVE!!!!!!!!
Quote Originally Posted by LennyPenny View Post
what a loseR
I really hope falco's scripts was made before well you know...
Quote Originally Posted by Xx Majestic xX View Post
I really hope falco's scripts was made before well you know...
nice bump that doesn't make sense at all!!! high quality post!!
Quote Originally Posted by Xx Majestic xX View Post
I really hope falco's scripts was made before well you know...
ok















......
Quote Originally Posted by SaganTM View Post
Hi folks,
Here is the Source to the Bunny Hopping and strafing script I have made.
Code:
local bhop_cv = CreateClientConVar("bocui_bhop", 0);
local auto_cv = CreateClientConVar("bocui_strafe", 0);
 
local FW = true; -- forward
local BW = false; -- backwards
local NONE = nil; -- neither
 
local cd = 6; -- cooldown
local ccd = 0; -- current cooldown
local lastc = 0; -- last cmd number
local lp = LocalPlayer(); -- localplayer
 
local function FWorBW(vel, ang)
        local a = vel;
        a:Rotate(-ang)
        if(a.x > 0) then
                return FW;
        elseif(a.x < 0) then
                return BW;
        end
        return NONE
end
 
local function bhopper(cmd)
        if(lp:GetMoveType() == MOVETYPE_NOCLIP or lp:WaterLevel() >= 2) then return; end --does it make sense to jump?  -- noclip src 12
        if (cmd:KeyDown(IN_JUMP)) then
                if(auto_cv:GetBool()) then
                        local mul = FWorBW(lp:GetVelocity(), lp:EyeAngles()) == BW and -1 or 1;
                        if(cmd:GetMouseX() < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = -cd;
                        elseif(cmd:GetMouseX() > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = cd;
                        elseif(ccd < 0) then
                                cmd:SetSideMove(-10000 * mul);
                                ccd = ccd + 1;
                        elseif(ccd > 0) then
                                cmd:SetSideMove(10000 * mul);
                                ccd = ccd - 1;
                        end
                end
                if (lp:OnGround() and cmd:CommandNumber() ~= lastc + 1) then
                        cmd:SetButtons(bit.bor(cmd:GetButtons(), IN_JUMP));
                        if(cmd:CommandNumber() ~= 0) then lastc = cmd:CommandNumber(); end
                        return;
                end
        end
        cmd:RemoveKey(IN_JUMP);
end
 
 
-- preperation
hook.Remove("CreateMove", "bunnyhop");
if(bhop_cv:GetBool()) then
        hook.Add("CreateMove", "bunnyhop", bhopper);
end
-- end of prep
 
 
cvars.AddChangeCallback("bocui_bhop", function()
        if(bhop_cv:GetBool()) then
                hook.Add("CreateMove", "bunnyhop", bhopper);
        else
                hook.Remove("CreateMove", "bunnyhop");
        end
end)
 
MsgC(Color(0,255,0), "\nBocui Bhop initialized!\n");
thank you you are a very talented coder, +rep
lmao dude did you even try
Move to coding section.
NICE DUDE THIS IS TOP HERA TYLER WAREING QUALITY!
stop bumping this autistic thread
Posts 1–15 of 16 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us