local humanoid = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("Humanoid");
-- note that typically gravity should be a negative value, but in this case I leave it positive hence the lack of -2 throughout the code
-- set the jump height to 10
humanoid.JumpPower = math.sqrt(2*game.Workspace.Gravity*10);
humanoid.StateChanged:Connect(function(old, new)
if (new == Enum.HumanoidStateType.Jumping) then
local h = humanoid.JumpPower^2/(2*game.Workspace.Gravity);
local t = 2*humanoid.JumpPower/game.Workspace.Gravity;
wait(t);
print(string.format("Jump took %s seconds and reached a max height of %s studs", t, h));
end
end)
This can be used from Modeling a projectile's motion to calculate both time and height, combining with the x,z velocity, we can technically use it.