How can i prevent player from spam jumping without changing the players speed or jump power

i have a custom movement system and i want to disable spam jumping (player holding down spacebar to keep jumping)

local Game = game
local UserInputService = Game:GetService("UserInputService")
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:FindFirstChildOfClass("Humanoid") or Character:WaitForChild("Humanoid")

local function OnInputBegan(InputObject)
	if InputObject.KeyCode.Name == "Space" then task.wait() Humanoid:SetStateEnabled("Jumping", false) Humanoid.WalkSpeed += 10 task.wait(0.5) end
end

local function OnInputEnded(InputObject)
	if InputObject.KeyCode.Name == "Space" then task.wait() Humanoid:SetStateEnabled("Jumping", true) Humanoid.WalkSpeed -= 10 task.wait(0.5) end
end

UserInputService.InputBegan:Connect(OnInputBegan)
UserInputService.InputEnded:Connect(OnInputEnded)

^ script i used before

May I ask why changing the JumpPower is undesirable?

cuz with my movement it scales jumppower with walkspeed and it messes things up when they get changed

Could you temporarily set the jumpPower to 0 and then set it back to its original value after x seconds? I think there is only one way to stop the player from jumping