Jump Combo / Timing (Please move, wrong section.)

I am creating a bhop system and Im aiming towards making it so you have to click space right before you hit the ground to gain a speed bonus but I do not know how to achieve this?

I’ve thought about calculating the distance between the player and the floor with raysand then time it do that but at the same time I don’t know how to achieve this?

local DistanceRay = Ray.new(Character.LeftFoot.Position, Vector3.new(0, -1, 0) *100)
local Part = game.Workspace:FindPartOnRay(DistanceRay, Character)

Just realised this is in the wrong section, please move!

If it’s in the wrong section simply click the edit button beside the thread title and change it from there.

I don’t think you’d need any raycasting or distance from the ground at all, all you need is to check if the player is holding space when they land, and how long they have been holding it.
the way i would tackle this is as follows:

1.Create a variable, something like LastJumpPress - this holds the tick(local time) value of the last time you pressed space (press down only)

2.Connect a function to UserInputService.InputBegan (with checks to ensure it was the jump button)
and when you press jump the variable would become LastJumpPress = tick()

3.Connect a function to Humanoid state change to Enum.HumanoidStateType.Landed (or the equivalent if you have a custom non-humanoid character)
the function would check if the player is holding the jump button AT THIS MOMENT by
IsHolding = UserInputService:IsKeyDown(Enum)
and if they are holding the key, then check how long they have been holding (if your games logic requires to) the time passed between the landing and pressing the button would be
tick() - LastJumpPress (basically the current time - time we pressed the button, in seconds)
do some checks of your choice, for example if they pressed about 1 to 0.1 seconds earlier than the landing then perform a longer jump, velocity would be the jump velocity + something higher and towards the direction the player is facing (or moving, your choice), otherwise just do a normal jump!