I'm trying to make one if statement only fire if the key was held for not more than 0.5 seconds, while the other if statement will fire if it was pressed for at least 0.5 seconds, but the first if statement will fire also if I try to fire the second if statement. How do I solve this problem?
local shortdebounce = false
local pass = tick()
if not shortdebounce and pass - tick() < 0.5 then
game.ReplicatedStorage.FruitRemotes.GomuGomu.ShortPistol:FireServer(mouse.Hit, script.Parent)
end
if UIS:IsKeyDown(Enum.KeyCode.Z) and pass - tick()>= 0.5 and not shortdebounce then
game.ReplicatedStorage.FruitRemotes.GomuGomu.Pistol:FireServer(mouse.Hit, script.Parent)
end
