Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script not working for jump delay + jump power Please help and also why? [closed]

Asked by 5 years ago
Edited 5 years ago

I need help, I need a script that does a jump delay + jump power script, Credit on the script bellow to @WideSteal321

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        if char:WaitForChild("Humanoid")  then
            print("working ok????????????????????????????????????????????????")
        end
        char.Humanoid.Changed:Connect(function(jumppppp)
            if char.Humanoid.Jump == true then
                char.Humanoid.JumpPower = 0
                print(char.Humanoid.JumpPower)
                wait(2.9)
                char.Humanoid.JumpPower = 50
                print(char.Humanoid.JumpPower)
                wait()
            end
        end)
    end)
end)
0
ye i made bad script :dab: ur welcome WideSteal321 773 — 5y
0
This site is not for requests. DinozCreates 1070 — 5y

Closed as Not Constructive by DinozCreates and User#24403

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
Azarth 3141 Moderation Voter Community Moderator
5 years ago
Edited 5 years ago

You can use UserInputService to detect a jump and StateChanged to tell whether or not you're allowed to jump. To find the delay, subtract now (tick) from the last jump time.

This is a LocalScript in StarterCharacterScripts

local me = game:GetService('Players').LocalPlayer
local character = me.Character
local humanoid = character:WaitForChild("Humanoid")

local uis = game:GetService('UserInputService')

local canjump = false
local last = tick()
local delaytime = 1

humanoid.JumpPower = 0

humanoid.StateChanged:Connect(function(old, new)
    if new == Enum.HumanoidStateType.Landed then 
        -- make sure we're on the floor 
        canjump = true
    elseif new == Enum.HumanoidStateType.Freefall then
        canjump = false
    end
end)

local function jump()
    if tick() - last >= delaytime and canjump then 
        print("do the thing")
        humanoid.JumpPower = 50
        delay(.25, function() humanoid.JumpPower = 0 end)
        last = tick()
    end
end

uis.JumpRequest:Connect(jump)
0
He said, this script someone else made for me doesnt work can someone make another :\ DinozCreates 1070 — 5y
Ad