I want to add a cooldown to the space bar that disables it temporarily after the player lands. I'm not trying to add a cooldown to jumping but to the space bar. I don't know where I went wrong, any help?
UserInputService = game:GetService("UserInputService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local isJumping = false
local UserInputService = game:GetService("UserInputService")
local DisablingJumpingTime = 5
UserInputService.InputBegan:Connect(function(input,gameProccesedEvent)
if input.KeyCode == Enum.KeyCode.Space then
if not isJumping then
isJumping = true
wait()
input.Keycode.Space = false
end
elseif input == Enum.HumanoidStateType.Landed then
if isJumping then
isJumping = false
wait(DisablingJumpingTime)
input.Keycode.Space = true
end
end
end)
