of     1   

Luxurize
#182241017Saturday, January 23, 2016 6:05 PM GMT

So I've been trying to create a script which allows the player to charge their jump height by holding space. It works, but the humanoid doesn't actually update the first time they release space. If they hit space while they're in the air, the humanoid will show that the player is jumping. (Also, sorry for the re-post; didn't think the other title was clear enough) local PlayerService = game:GetService("Players") local Player = PlayerService.LocalPlayer repeat wait() until Player.Character local Character = Player.Character local ChargingJump = false local MidJump = false local Jumping = false local Debounce = false local JumpHeight = 0 local JumpHeightLimit = 200 local UserInputService = game:GetService("UserInputService") local Keys = { [Enum.KeyCode.Space] = false } local Anims = { ChargingJump = "http://www.roblox.com/Asset?ID=346933059"; LandedJump = "http://www.roblox.com/Asset?ID=346941183"; } local JumpAni = Instance.new("Animation") JumpAni.Name = "ChargingJump" JumpAni.AnimationId = Anims.ChargingJump ChargingJump_Ani = Character.Humanoid:LoadAnimation(JumpAni) local LandedAni = Instance.new("Animation") LandedAni.Name = "LandedJump" LandedAni.AnimationId = Anims.LandedJump LandedJump_Ani = Character.Humanoid:LoadAnimation(LandedAni) function ChargeJump() local function Updater() if Keys[Enum.KeyCode.Space] then if Character.Humanoid.Jump then Character.Humanoid.Jump = false end end end if Character.Humanoid.Changed:connect(Updater) then repeat ChargingJump_Ani:Play() for Height = 0, JumpHeightLimit, 2 do ChargingJump = true wait() print(Height) JumpHeight = Height if JumpHeight == JumpHeightLimit then break end if Keys[Enum.KeyCode.Space] == false then break end end until Keys[Enum.KeyCode.Space] == false or JumpHeight == JumpHeightLimit end end UserInputService.InputBegan:connect(function(InputObject) if Keys[InputObject.KeyCode] == false then if not ChargingJump and not MidJump then Keys[InputObject.KeyCode] = true ChargeJump() end end end) UserInputService.InputEnded:connect(function(InputObject) if Keys[InputObject.KeyCode] then Keys[InputObject.KeyCode] = false ChargingJump = false if not ChargingJump then ChargingJump_Ani:Stop() end MidJump = true print("Ayy lmao") Character.Humanoid.Jump = true Character.Torso.Velocity = Vector3.new(0, JumpHeight, 0) end end) “Insane isn't always black or white. We're all pathological, in our own ways.”
Luxurize
#182241428Saturday, January 23, 2016 6:10 PM GMT

Bumpity bump. “Insane isn't always black or white. We're all pathological, in our own ways.”
Luxurize
#182242100Saturday, January 23, 2016 6:18 PM GMT

Ugh, and another bump. Really would like some help here. “Insane isn't always black or white. We're all pathological, in our own ways.”
script_frog
#182242161Saturday, January 23, 2016 6:19 PM GMT

I can explain what I did to do mine in-game if u want i make u math.sqrt()
Luxurize
#182242282Saturday, January 23, 2016 6:20 PM GMT

Sure, as long as I have one which works as intended as the final product. “Insane isn't always black or white. We're all pathological, in our own ways.”
script_frog
#182242311Saturday, January 23, 2016 6:21 PM GMT

I'm at the game where I created mine, join up and i'll explain what I did. i make u math.sqrt()
Luxurize
#182330865Sunday, January 24, 2016 8:34 PM GMT

Ugh, bump. I've tried what Illegally suggested and I still can't seem to get it to work. “Insane isn't always black or white. We're all pathological, in our own ways.”
Luxurize
#182332616Sunday, January 24, 2016 8:57 PM GMT

And another bump. “Insane isn't always black or white. We're all pathological, in our own ways.”

    of     1