#How do I get the animation from the table?

1 messages · Page 1 of 1 (latest)

summer hatch
#

I want this script to count down, and when it reaches a certain number it plays the corresponding animation. how do i do that?

hardy kindle
#

Maybe I'm not 100% the objective

summer hatch
woeful moon
charred island
#

I see you finicking around with waits, if you want to add a timeout period here's the code for that

#
local ComboCount = 0
local LastHit = 0

tool.Activated:Connect(function()
  local timePassed = os.clock() - LastHit
  if timePassed > TIMEOUT then
    ComboCount = 0
  end
  ComboCount = CombotCount % MaxCombo + 1
  AnimationTracks[ComboCount]
  LastHit = os.clock()
end)
#

os.clock() returns time passed since some specific time based on the device

#

By saving when the last attack happened you can deduct it from the current time to get how much time has passed since.

#

% gives you the remainder of if you were to do division, which is useful for looping numbers.

Here's an example

3 % 5 = 3
4 % 5 = 4
5 % 5 = 0

since in the code I am also adding one it will keep incrementing and eventually reset once it reaches 5