Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make this animation restart?

Asked by 4 years ago
Edited 4 years ago
01local anim = Instance.new("Animation")
03local track = p.Character.Humanoid:LoadAnimation(anim)
04if phase == 1 then
05    local date = Instance.new("IntValue")
06    date.Name = "BreathData"
07    date.Value = DateTime.now().UnixTimestampMillis
08    date.Parent = p.Data
09    p.Character.Humanoid.WalkSpeed = 0
10    p.Character.Humanoid.JumpPower = 0
11    wait()
12    track:Play()
13    wait(.8)
14    track:AdjustSpeed(0)
15    if p.Data:WaitForChild("BreathData",.1) == nil then
View all 47 lines...

this is a part of my code. at phase == 2 i try to continue the animation that i paused at phase == 1.

01if p.Data:WaitForChild("BreathData",.1) == nil then
02    print("1")
03    track:AdjustSpeed(1)
04    wait(.5)
05    p.Character.Humanoid.WalkSpeed = 16
06    p.Character.Humanoid.JumpPower = 50
07    local cooldown = Instance.new("BoolValue")
08    cooldown.Value = true
09    cooldown.Name = "Breath"
10    cooldown.Parent = p.Data.Cooldowns
11    wait(5)
12    cooldown:Remove()
13end

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

Answer this question