How to check if a Player is holding Space?

The only problem that I would have with using this, is that I am using Gravity Controller, and every player’s HumanoidStateType is set to PlatformStand constantly.

I have found success using the StateTracker included within the Gravity Controller kit, but when it comes to the issues I am having with this charge jump, I am not sure how to get around it.
(You can get the gravity controller through the hyperlink as it is a free system and open sourced, if you would like to know more about why I am using a different StateTracker)

The only problem I currently have is disabling Jump on Space press while also being able to reenable it somehow. Here is a GIF showing that the print function of the script is working in output:
https://gyazo.com/3d2a5836fea0b08f58550289f5b82665

Here is the script that I currently have; Im sure it just needs a few changes when compared to yours but I’m not sure where to begin since I’ve only been scripting for a few weeks haha

  • It is something with setting humanoid.Jump = false but I am unsure of another way to do this
Summary
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local oldPower
local jump_multi = 2 

local State = character:WaitForChild("State")

local inputTime
humanoid.JumpPower = oldPower


UIS.InputBegan:Connect(function(input, gameProcessed)
	if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.Space then
		humanoid.Jump = false
		inputTime = time()
	end
end)

UIS.InputEnded:Connect(function(input, gameProcessed)
	if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode == Enum.KeyCode.Space then
		humanoid.Jump = true
		if time() - inputTime >= 1 then
			print("Charge Jump Worked")
			humanoid.JumpPower = 50 * jump_multi
		end
		humanoid.Jump = true
	end
end)