INFORMATION: I was working on a melee tool for a while now, everything was going smoothly until I wanted to make it where if the player jumps and presses q in a certain time they will do an overhead attack that will do stuff later on, but while scripting it, nothing prints, can I get some help?
PROBLEM: (What I presume) The script gets to a certain point and the script and freezes/stops and does not print anything.
SCRIPT:
-- change variable when player jumps
character.Humanoid.Jumping:Connect(function()
jumping = true
end)
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
if toolEquipped == false then return end;
if kicking or guarding or usingSpeical == true then return end;
if not punching then
punching = true
-- overhead
if jumping == true then
if tick()-timer < 0.15 then
print("overhead")
wait(0.5)
punching = false
end
timer = tick()
else
if tick()-timer > 2 then
punchAnimation = 0
end
timer = tick()
punchAnimation = punchAnimation + 1
local ActionAnimation = character.Humanoid:LoadAnimation(replicatedStorage.Animations["MeleePunch"..punchAnimation])
ActionAnimation:Play()
actions.Punch:InvokeServer(punchAnimation)
if punchAnimation >= 2 then
punchAnimation = 0
end
end
end)
Any help would be greatly appreciated!

2 comments
actually you couldnt have triggered it even if you're careful because the first time would have set it to false and only the second time can trigger the combo....
and in general i suggest moving duplicate code out of the if-else statement, such as "timer = tick()"