Basically what I want is that you jump, and then you can launch yourself to higher places and then play an animation to land. Scripting knowledge is very little and I can't access the wiki.

I'm trying to make a GUI with a value for fuel and once you run out of fuel you can no longer continue to jump, I would also like particles to come out of a R16 Rigs foot and animation placeholder. I'd try to do it myself but cant access the wiki and its extremely frustrating not knowing what to do. Help and explain how and why or what I need to look into.

Player Jumps and can jump infinitely until the GUI dictates that they have ran out of fuel then they land. To refill fuel simply land and be on the floor for longer than 2 seconds.

Thank you for your time!

local plr = game.Players.LocalPlayer;
local jumped = false;
local key;
local debounce = false;

local function IsKeyDown(keyCode)
    local is_down = false;
    local keys = game:GetService("UserInputService"):GetKeysPressed();
    for i,v in pairs(keys) do
        if v.KeyCode == keyCode then
            is_down = true;
        end
    end
    return is_down;
end

local jump_limit = 8; --the max amount of times a player can 're-jump'

spawn(function()
    local local_limit = 0; 
    while wait() do
        if jumped then
            while IsKeyDown(key) do
                pcall(function()
                    plr.Character.Humanoid:ChangeState(
                        Enum.HumanoidStateType.Jumping);
                end);
                local_limit = local_limit + 1;
                wait(1 / 5);
                if local_limit >= jump_limit then
                    local_limit = 0;
                    break;
                end
            end
            jumped = false;
            key = nil;
        end
        debounce = false;
    end
end);

game:GetService("UserInputService").InputBegan:connect(function(input)
    if not debounce then
        debounce = true;
        if input.KeyCode == Enum.KeyCode.Space or
            input.KeyCode == Enum.KeyCode.ButtonA then
            key = input.KeyCode;
            jumped = true;
        end
    end
end);

3 comments

1

why can't you access the wiki?

0

Exactly. Clearly your just some lazy kid who wants to make a jailbreak.

0

Hey, back off this kid, he put effort into this script, and maybe he doesn't know about wiki.