Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- timer.Simple(1, function()
- surface.CreateFont( "sHop", { font = "Arial", size = 15, weight = 750, antialias = false, outline = true } )
- local Version = "1337"
- local Enabled = true
- local curSpeed = 0
- local maxSpeed = 0
- local sHop = {}
- /*
- Helper functions
- */
- function sHop.AddHook( Type, Function )
- Name = "[sHop] - " .. math.random( 1, 10000 )
- hook.Add( Type, Name, Function )
- end
- function sHop.AddCommand( Name, Function )
- concommand.Add( Name, Function )
- end
- /*
- Core functions
- */
- function sHop.HUD()
- curSpeed = math.Round( LocalPlayer():GetVelocity():Length() )
- if ( curSpeed > maxSpeed && LocalPlayer():Alive() ) then
- maxSpeed = curSpeed
- end
- if Enabled then
- draw.RoundedBox( 4, 10, 10, 150, 70, Color( 0, 0, 0, 150 ) )
- draw.SimpleText( "sHop " .. Version, "sHop", 50, 15, Color( 50, 200, 50, 255 ) )
- draw.SimpleText( "Speed: " .. curSpeed, "sHop", 20, 30, Color( 255, 255, 255, 255 ) )
- draw.SimpleText( "Max Speed: " .. maxSpeed, "sHop", 20, 45, Color( 255, 255, 255, 255 ) )
- draw.SimpleText( "Coded by Snip", "sHop", 30, 60, Color( 200, 40, 60 ) )
- end
- end
- local bhop = { };
- bhop.MetaPlayer = FindMetaTable( "Player")
- bhop.oldKeyDown = bhop.MetaPlayer['KeyDown']
- local bhopOn = true;
- local bhopSOn = true;
- local bhopHooks = { hook = { }, name = { } };
- bhop.left = false
- bhop.right = false
- bhop.jump = false
- bhop.what = true
- function bhop.AddHook(hookname, name, func)
- table.insert( bhopHooks.hook, hookname );
- table.insert( bhopHooks.name, name );
- hook.Add( hookname, name, func );
- end
- bhop.MetaPlayer['KeyDown'] = function( self, key )
- if self != LocalPlayer() then return end
- if (key == IN_MOVELEFT) and bhop.left then
- return true
- elseif (key == IN_MOVERIGHT) and bhop.right then
- return true
- elseif (key == IN_JUMP) and bhop.jump then
- return true
- else
- return bhop.oldKeyDown( self, key )
- end
- end
- function bhop.spamjump()
- bhop.what = false
- bhop.jump = true
- timer.Simple(.05, function()
- bhop.jump = false
- timer.Simple( .25, function()
- bhop.what = true
- end)
- end)
- end
- local oldEyePos = LocalPlayer():EyeAngles()--This is to see where player is looking
- function bhop.CreateMove( cmd )
- local JumpReleased = false;
- if (cmd:KeyDown( IN_JUMP )) then
- if (!JumpReleased) then
- if (bhopOn && !LocalPlayer():OnGround()) then --Bhop here
- cmd:RemoveKey( IN_JUMP );
- if bhop.what then
- bhop.spamjump()
- end
- end
- else
- JumpReleased = false
- end
- if(bhopSOn ) then--auto strafer
- local traceRes = LocalPlayer():EyeAngles()
- if( traceRes.y > oldEyePos.y ) then --If you move your mouse left, walk left, if you're jumping
- oldEyePos = traceRes;
- cmd:SetSideMove( -1000000 )
- bhop.left = true
- timer.Simple(1, function() bhop.left = false end)
- end
- if( oldEyePos.y > traceRes.y ) then --If you move your mouse right, move right, while jumping
- oldEyePos = traceRes;
- cmd:SetSideMove( 1000000 )
- bhop.right = true
- timer.Simple(1, function() bhop.right = false end)
- end
- end
- elseif (!JumpReleased) then
- JumpReleased = true;
- end
- end
- bhop.AddHook( "CreateMove", tostring(math.random(0, 133712837)), bhop.CreateMove )--add the hook
- concommand.Add( "sHop", function () --Toggler
- if bhopOn then
- print("sHop off")
- bhopOn = false;
- else
- print("sHop on")
- bhopOn = true;
- end
- end )
- concommand.Add( "sHop_strafe", function ()
- if bhopSOn then
- print("Strafe off")
- bhopSOn = false;
- else
- print("Strafe on")
- bhopSOn = true;
- end
- end)
- concommand.Add("sHop_unload", function()
- for i = 1, #bhopHooks.hook do
- hook.Remove( bhopHooks.hook[i], bhopHooks.name[i] );
- print( "Unhooked "..bhopHooks.hook[i].." using name "..bhopHooks.name[i] );
- end
- concommand.Remove("sHop_strafe")
- concommand.Remove("bhop")
- bhopOn = false;
- bhopSOn = false;
- print("sHop unloaded")
- table.Empty( bhopHooks )
- concommand.Remove( "sHop_unload" )
- end)
- /*
- Hooks and command adding.
- */
- sHop.AddHook( "HUDPaint", sHop.HUD )
- chat.AddText( Color( 255, 255, 50 ), "[sHop " .. Version .. "] ", Color( 255, 255, 255 ), "Loaded sHop!" )
- end )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement