So I made this custom jump thing but it still goes when somebody presses space while typing. How do I fix this?
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local char = plr.Character
local human = char:WaitForChild("Humanoid")
local inputservice = game:GetService("UserInputService")
coolDown = false
local jumpvelocity = 75
--Cancels out default jump
human.Changed:connect(function()
human.Jump = false
end)
animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://513291588"
animationTrack = plr.Character.Humanoid:LoadAnimation(animation)
--Jumps while pressing space while typing... Add your own debounce too.
inputservice.InputBegan:connect(function(inputobject)
if inputobject.KeyCode == Enum.KeyCode.Space and coolDown == false then
animationTrack:Play()
coolDown = true
char.Torso.Velocity = Vector3.new(0,jumpvelocity,0)
wait(5)
coolDown = false
end
end)
