#Double Jump Script Bug

1 messages · Page 1 of 1 (latest)

lime hamlet
#

I have a double jump script but for some reason it lets you hold the jump button and double jump instantly

#

im holding down the spacebar the entire time

full atlas
#

0 print statements💔

lime hamlet
frosty thornBOT
#

studio** You are now Level 1! **studio

sour valve
#

@lime hamlet

sour valve
#

You now have to let go of the jump button after your first jump before you can double‑jump, now holding it down won’t trigger the second jump anymore

#

@lime hamlet

full atlas
#

printing is the first step to debugging

lime hamlet
full atlas
frosty thornBOT
#

studio** You are now Level 3! **studio

lime hamlet
#

What if I told you I got rid of the print statements in an attempt to fit it into one message on Discord?

full atlas
#

k

#

you sent a message.txt regardless

lime hamlet
#

I realized that

full atlas
#

lmfao

lime hamlet
#

it was 3am give me a break

sour valve
lime hamlet
sour valve
#

anyways i think we alr solved this one

sour valve
#

about the state of the bug

#

i think i fixed that too

#

its working when i tried testing it

lime hamlet
sour valve
#

double*

lime hamlet
#

its random

sour valve
lime hamlet
frosty thornBOT
#

studio** You are now Level 5! **studio

sour valve
#

ima fix it real quick

#

@lime hamlet

#

use my script instead

#

it works perfectly


#

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local rootPart = character:WaitForChild("HumanoidRootPart")

local canDoubleJump = false
local hasDoubleJumped = false
local jumpDebounce = false

player.CharacterAdded:Connect(function(char)
character = char
humanoid = character:WaitForChild("Humanoid")
rootPart = character:WaitForChild("HumanoidRootPart")
hasDoubleJumped = false
end)

humanoid.StateChanged:Connect(function(_, state)
if state == Enum.HumanoidStateType.Landed then
hasDoubleJumped = false
canDoubleJump = false
end
end)

humanoid.Jumping:Connect(function(isActive)
if isActive and not hasDoubleJumped then
canDoubleJump = true
end
end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Space
and canDoubleJump
and not hasDoubleJumped
and not jumpDebounce then
jumpDebounce = true
hasDoubleJumped = true
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
task.wait(0.2)
jumpDebounce = false
end
end)

lime hamlet
sour valve
#

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")

local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local doubleJumpAnimationId = "rbxassetid://108415556369442"
local animationTrack

local canDoubleJump = false
local hasDoubleJumped = false
local jumpDebounce = false

player.CharacterAdded:Connect(function(char)
character = char
humanoid = character:WaitForChild("Humanoid")
hasDoubleJumped = false
end)

humanoid.StateChanged:Connect(function(_, state)
if state == Enum.HumanoidStateType.Landed then
hasDoubleJumped = false
canDoubleJump = false
end
end)

humanoid.Jumping:Connect(function(isActive)
if isActive and not hasDoubleJumped then
canDoubleJump = true
end
end)

UserInputService.InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.Space
and canDoubleJump
and not hasDoubleJumped
and not jumpDebounce then
jumpDebounce = true
hasDoubleJumped = true
humanoid:ChangeState(Enum.HumanoidStateType.Jumping)

    if not animationTrack or not animationTrack.IsPlaying then
        local anim = Instance.new("Animation")
        anim.AnimationId = doubleJumpAnimationId
        animationTrack = humanoid:LoadAnimation(anim)
        animationTrack.Looped = false
        animationTrack:Play()
        animationTrack.Stopped:Connect(function()
            animationTrack:Stop()
        end)
    end

    task.wait(0.2)
    jumpDebounce = false
end

end)

#

@lime hamlet will it work now, and is it for R6 or R15?

lime hamlet
sour valve
#

basically

#

i fixed the animation

#

..

#

with Animation Spoofer v2

#

@lime hamlet

lime hamlet
sour valve
#

heres the id

#

85037193290633

sour valve
#

anyways the animation is a front flip

lime hamlet
#

indeed

lime hamlet
#

basically I have a bounce pad but I want the player to be able to double jump after each time they hit the bounce pad but the game doesnt count it as hitting the ground

sour valve
#

btw this script is only for R15 but the animation is buggy as hell 😭

frosty thornBOT
#

studio** You are now Level 3! **studio

lime hamlet
sour valve
#

bc the animation supports only R15

#

want the animation deleted?

lime hamlet
sour valve
#

its only R15

lime hamlet
#

uuuuugh

#

ok let me find an r6 one

lime hamlet
# sour valve its only R15

I might be able to just swap the characters to r15 later instead but I need the owner of the game to wake up

#

ill let you know

sour valve
#

k