system.runInterval(() => {
for (const player of world.getPlayers()) {
if (player.isJumping && player.hasTag('sprint') && (player.getVelocity().x != 0 || player.getVelocity().z != 0)) {
player.applyKnockback(player.getVelocity().x, player.getVelocity().z, 0.4, 0.3)
}
}
});```
the code has 2 problems
- whenver i hold jump button, it keep execute applyKnockback
- even i stop and not move, if i jump the player jumps forward, not jump where he stays
#recreate sprint jump bug
1 messages · Page 1 of 1 (latest)
what is sprint jump bug
i mean i wanna make walking jump like sprint jump where player has more velocity or speed
try separating (player.getVelocity...) into another if condition (i said this because you were using || operator)
player.isOnGround
like if (player.isonground) {
if (...) {
}
}
right
lemme test this when i get home