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

My animation script isn't working and I don't know why?

Asked by
sheepposu 561 Moderation Voter
5 years ago
Edited 5 years ago

I looked up how to play an animation and did the same code but it didn't work. There are no errors. Any help on what I am doing wrong is appreciated. Animation ID - rbxassetid://3408083014

local animation = script.Parent.Parent.Animation

script.Parent.Parent.Activated:Connect(function()
    local plr = game.Players:WaitForChild(script.Parent.Parent.Parent.Name)
    local char = plr.Character
    local humanoid = char.Humanoid
    local track = humanoid:LoadAnimation(animation)
    print('Play')
    track:Play()
    print('Done')
end)
0
Where is the animtion located? Freddan2006YT 88 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

This should work, just change up the parent's and stuff like that

wait(0.2)
local animation = script.Parent.Parent.Parent.Animation

script.Parent.Activated:Connect(function()
    wait(0.1)
    local plr = game.Players.LocalPlayer
print(plr)
    local hum = plr.Character.Humanoid
    local track = 
                    hum:LoadAnimation(animation)
    track:Play()
end)
0
Still didn't work sheepposu 561 — 5y
0
What does the output say? Freddan2006YT 88 — 5y
0
Nothing sheepposu 561 — 5y
0
Sheep, add me to a tc with just this script and ill see if I can help. Pooglies 7 — 5y
View all comments (2 more)
0
Ok ,it's a blank world, I was making food items for my client sheepposu 561 — 5y
0
We have to be friends first so I sent u a friend request sheepposu 561 — 5y
Ad

Answer this question