How can I make this animation restart?
Asked by
4 years ago Edited 4 years ago
01 | local anim = Instance.new( "Animation" ) |
03 | local track = p.Character.Humanoid:LoadAnimation(anim) |
05 | local date = Instance.new( "IntValue" ) |
06 | date.Name = "BreathData" |
07 | date.Value = DateTime.now().UnixTimestampMillis |
09 | p.Character.Humanoid.WalkSpeed = 0 |
10 | p.Character.Humanoid.JumpPower = 0 |
15 | if p.Data:WaitForChild( "BreathData" ,. 1 ) = = nil then |
19 | p.Character.Humanoid.WalkSpeed = 16 |
20 | p.Character.Humanoid.JumpPower = 50 |
21 | local cooldown = Instance.new( "BoolValue" ) |
23 | cooldown.Name = "Breath" |
24 | cooldown.Parent = p.Data.Cooldowns |
29 | local get = p.Data:WaitForChild( "BreathData" ,. 1 ) |
31 | local power = DateTime.now().UnixTimestampMillis - get.Value |
34 | print ( tostring (track)) |
38 | p.Character.Humanoid.WalkSpeed = 16 |
39 | p.Character.Humanoid.JumpPower = 50 |
40 | local cooldown = Instance.new( "BoolValue" ) |
42 | cooldown.Name = "Breath" |
43 | cooldown.Parent = p.Data.Cooldowns |
44 | print ( tostring (power)) |
this is a part of my code. at phase == 2 i try to continue the animation that i paused at phase == 1.
01 | if p.Data:WaitForChild( "BreathData" ,. 1 ) = = nil then |
05 | p.Character.Humanoid.WalkSpeed = 16 |
06 | p.Character.Humanoid.JumpPower = 50 |
07 | local cooldown = Instance.new( "BoolValue" ) |
09 | cooldown.Name = "Breath" |
10 | cooldown.Parent = p.Data.Cooldowns |
while this part of code works without problem, i cant continue the animation at phase == 2. they are the same thing why?
power isn't none and track isn't nil