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

Why does "Jumped" always return false?

Asked by 5 years ago

so im trying to make a spindash (ability from Sonic) script and i've run into a problem where if you hold shift in the air, the first half obviously doesnt execute, but if you then release shift after you landed the second half does execute, i tried to bandage this with a "Jumped" value that should be changed to true if the player holds shift while in the air. Yet it always returns false whenever i ask it to be printed

01local UIS = game:GetService("UserInputService")
02local Player =  game.Players.LocalPlayer.Character
03local humanoid = Player.Humanoid
04local anim = Instance.new("Animation")
06local counter = 157 --put the character's walkspeed here
07local OrgWS = 157 --put the character's walkspeed here
08local debounce = false
09local playAnimA = humanoid:LoadAnimation(anim)
10local Jumped = false
11UIS.InputBegan:Connect(function(inst)
12  if not debounce then
13   if humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then
14      if inst.KeyCode == Enum.KeyCode.LeftShift then
15        debounce = true
View all 76 lines...

here's is the localscript btw.

0
have you tried checking if lines 32 - 34 are being run? IBlackViper 2 — 5y
0
They aren't, and i dont know why Roviospace 22 — 5y

Answer this question