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

How to use Stopped() for Animation Tracks?

Asked by 6 years ago

I'm confused on how to use the stopped() event for animation tracks. Whenever I try to use it, the output says stopped is a userdata value.

1 answer

Log in to vote
0
Answered by 6 years ago
local plr = game:GetService("Players").LocalPlayer
local plr = plr.Character or plr.CharacterAdded:Wait()

local anim = Instance.new("Animation")
anim.Parent = plr.Character
anim.AnimationId = "somethingHere"
local track = plr.Character.Humanoid:LoadAnimation(anim)
track:Play()
track.Stopped:Connect(function()
    --do code
end)
0
i meant "local char" in the second line but whatever Gey4Jesus69 2705 — 6y
Ad

Answer this question