Hello, i am trying to stop a walking animation after a npc has walked to a place, but i can’t make the animation stop.
I have tried to just type :Stop(), but that didn’t work. I then tried to read some stuff about animations, but i could not find a solution.
My last try was to type :Stop()
and then play a diffrent animation but that didn’t work.
Thanks for you answers in advance!
Here is my script:
local rep = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local part = game.Workspace.cammove.Part
local remote = rep:WaitForChild("run")
local runAnimation = game.Workspace.Davidsuperhero1076:WaitForChild("WalkAnim")
local WalkAnimationTrack = game.Workspace.Davidsuperhero1076.Humanoid:LoadAnimation(runAnimation)
print("AAAAAAAAAAA")
local function on()
WalkAnimationTrack:Play()
game.Workspace.Davidsuperhero1076.UpperTorso.Transparency = 1
game.Workspace.Davidsuperhero1076.Humanoid:MoveTo(game.Workspace.move1.Position)
game.Workspace.Davidsuperhero1076.Humanoid.MoveToFinished:Wait()
game.Workspace.Davidsuperhero1076.LeftUpperArm.Transparency = 1
game.Workspace.Davidsuperhero1076.RightUpperArm.Transparency = 1
game.Workspace.walk.Value = 1
wait(2)
game.Workspace.Davidsuperhero1076.UpperTorso.Transparency = 0
game.Workspace.Davidsuperhero1076.LeftUpperArm.Transparency = 0
game.Workspace.Davidsuperhero1076.RightUpperArm.Transparency = 0
game.Workspace.Davidsuperhero1076.Humanoid:MoveTo(game.Workspace.move2.Position)
game.Workspace.Davidsuperhero1076.Humanoid.MoveToFinished:Wait()
game.Workspace.Davidsuperhero1076.Humanoid:MoveTo(game.Workspace.move3.Position)
game.Workspace.Davidsuperhero1076.Humanoid.MoveToFinished:Wait()
game.Workspace.Davidsuperhero1076.Humanoid:MoveTo(game.Workspace.move4.Position)
game.Workspace.Davidsuperhero1076.Humanoid.MoveToFinished:Wait()
WalkAnimationTrack:Stop()
print("a")
end
remote.OnServerEvent:Connect(on)