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

This script from a wiki article I'm copying does not make me double jump?

Asked by 7 years ago

Hello, I was trying to make my own copy of this wiki article by typing it up myself instead of copy/paste, however, it doesn't work! It doesn't show an error in the output, but the player cannot use the double jump ability.

Here is my code:

01local UserInputService = game:GetService("UserInputService")
02local localPlayer = game.Players.LocalPlayer
03local character
04local humanoid
05 
06local canDoubleJump = false
07local hasDoubleJumped = false
08local oldPower
09local TIME_BETWEEN_JUMPS = 0.2
10local DOUBLE_JUMP_POWER_MULTIPLIER = 2
11 
12function onJumpRequest()
13    if not character or not humanoid or not character:IsDescendantOf(workspace) or
14         humanoid:GetState() == Enum.HumanoidStateType.Dead then
15        return
View all 49 lines...

And for comparison, the Wiki article code:

01local UserInputService = game:GetService("UserInputService")
02local localPlayer = game.Players.LocalPlayer
03local character
04local humanoid
05 
06local canDoubleJump = false
07local hasDoubleJumped = false
08local oldPower
09local TIME_BETWEEN_JUMPS = 0.2
10local DOUBLE_JUMP_POWER_MULTIPLIER = 2
11 
12function onJumpRequest()
13    if not character or not humanoid or not character:IsDescendantOf(workspace) or
14     humanoid:GetState() == Enum.HumanoidStateType.Dead then
15        return
View all 49 lines...
0
did you put it in a localscript? radusavin366 617 — 7y

1 answer

Log in to vote
0
Answered by
chasedig1 115
7 years ago

canDoubleJump is false.

1
I knew something was wrong! Thanks. AtomicChocolate 35 — 7y
Ad

Answer this question