New Bunny Hoppy Movement Code

Gotcha, thank you and will do (if I ever find out).

2 Likes

My friend seems to have a certain bug with this that makes them run at extreme speeds, but it works completely fine for me.

2 Likes

Huh, I have had that happen with my old code but with the new one that I posted on this forum I havenā€™t had that happen. If you can figure out why it happens or even fix it, then let me know.

1 Like

My friend took a wild guess that it might act differently with certain body parts, but I canā€™t really get my head around how it all works atm. Were you updating the code in the same link?

1 Like

That could be true, now that I think about it I have only ever used the thing with r6 avatars. I have never really thought about r15 or rthro. Iā€™ll try and look into it.

2 Likes

A bit confused, Iā€™m an Avid Csgo player, and I do a lot of airstrafing/csgo bhopping etc Iā€™m assuming this script is meant to replicate that right? Iā€™m noticing a lot of things that this system doesnā€™t include, correct me if Iā€™m wrong but the biggest one is, this doesnā€™t include air strafing at all does it? Theres no velocity being gained, Also Iā€™m noticing that if you turn your mouse around too quickly to head the other way you lose all speed, Iā€™ve been trying to replicate a system like bhop - Roblox

This, for quite some time, looking for different resources, is this system that youā€™ve made not intended to be like that where you gain speed through air strafing? and if so what is this for? Whatā€™s the point in bhopping if no speed is gained?

3 Likes

Yeah I have noticed the difference between my movement and csgo the reason is probably because I used this code from unity: Quake III movement (Strafe jumping) in Unity [#1] - YouTube, and translated that into lua pretty much. It appears that this bhop stuff was based off of quake. I originally used this code: Bunnyhopping from the Programmer's Perspective, but I did not like it because it was giving me some weird bugs that I could not solve.

Oh and also in my game I added a max velocity cap, because the players could get to fast and that messed with the gameplay, especially because it was really easy to bhop cause I had auto jump on.

If you set the maxSpeed to a higher value or removed the velocity cap altogether, then adjusted some of the variables you could probably get it very similar to what you want. What variables you need to adjust, i donā€™t know. Itā€™s very complicated math that I donā€™t even understand.

2 Likes

Mmm. Maybe Iā€™ll toy around a bit more with yours, Iā€™m just struggling finding how tf @Quaternions managed to get the system exactly how csgo did, I thought I was pretty decent at scripting but holy, the math involved with strafing, and all that stuff has been confusing tf out of me, Thank you for the resource anyways Iā€™m gonna try to achieve what I need it sucks that the resources on this topic are kinda limited though but thanks! was just curious

1 Like

has a wise man wants said, "hippty hoppty this code is now my property. with credit of course "

3 Likes

Hey really cool script! Although I have found the bunny hopping is a bit too abusive and I also want my bunny hopping to be more like the bunny hopping in Apex Legends so I made some modifications try it out for yourself if you want.

local LastJumpTime = 0
local JumpCount = 0
local Jumped

local function onJump(actionName, inputState)
	
	if inputState == Enum.UserInputState.Begin then
		if JumpCount <= 15 and LastJumpTime - tick() > -1 then
		Cmd.jump = true
		Cmd.justPressed = true
		Jumped = true
			print(JumpCount)
			print(LastJumpTime - tick())
		elseif LastJumpTime - tick() <= -1 then
			Cmd.jump = true
			Cmd.justPressed = true
			Jumped = true
			JumpCount = 1
			LastJumpTime = tick()
			print(JumpCount)
			print(LastJumpTime - tick())
		else	
			Jumped = false
		end
			
	elseif inputState == Enum.UserInputState.End then
		if Jumped == true then
			Cmd.jump = false
			LastJumpTime = tick()
			JumpCount = JumpCount + 1			
		end
	end

end

3 Likes

Is this possible to be done server sided? To avoid exploiters and such

2 Likes

Movement on roblox is never done on the server. Roblox doesnā€™t really allow it.

3 Likes

Can exploiters easily manipulate this to their advantage? (sorry for asking so much questions :sweat_smile:)

And also, I didnā€™t know that, atleast I know that now

2 Likes

Exploiters can cheat just like with any other movement system including robloxā€™s default system. However in my code I am constantly setting the humanoid.WalkSpeed so I guess it would be a little harder.

I did not add any anticheat measures to this, that is something you would have to do on your own.

3 Likes

Hey is there anyway for this to be compatible with R15?

4 Likes

Late to the party, has anyone found solution to make this system accept Xboxā€™s joystick movement than hardcoded rely on w/s/a/d?

1 Like

In general, for any type of WASD, joystick, or touch movement, you should use the Roblox ControlModule (after forking it and editing the return). The input code above is overcomplicated and only supports keyboard.

local Players = game:GetService("Players")
local PlayerModule = require(Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule"))
local ControlModule = PlayerModule:GetControls()

local function getMoveVector()
    return ControlModule:GetMoveVector()
end

This returns a Vector3 in local space. Note that itā€™s not a unit vector, and can be zero when the player doesnā€™t want to move.

3 Likes

Iā€™m not coding expert so I canā€™t rly use your help to edit the script so it works the way I ask, but thanks anyways.

1 Like

This is actually sick thanks for code!

1 Like

@SnarlyZoo Hey when I use this code, the game doesnā€™t listen for inputs. I have a C to Slide script inside the StarterCharacterScripts, but it doesnā€™t work, no printing, nothing.