Hello developers , today I was making a combat system. Basically, every time you click a value is added and they are called combos. At the moment the player is in combo 4 and is holding space an animation should play, at this moment I want a script to detect how many seconds he was in combo 4, this will help me to make a special attack. I am trying to use tick(), but I can’t do it. I would appreciate your help. I use translator by the way.
Script: (Not full script)
if UIS:IsKeyDown("Space") and combo == 4 and CanAir then -- If you are holding Space and it is in Combo 4
CanAir = false
AirStatus = "Up"
animation.AnimationId = airAnims[1]
print("Ouuu")
elseif not UIS:IsKeyDown("Space") and combo == 5 and not CanAir then -- If you are NOT holding Space and are in Combo 5
if tick() - timepass < .5 then --- no work
print("hi")
animation.AnimationId = airAnims[2]
AirStatus = "Down"
end
else
animation.AnimationId = punchAnims[combo]
end