Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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)

1 comment

0

Where is the animtion located?

1 answer

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)

6 comments

0

Still didn't work

0

What does the output say?

0

Nothing

0

Sheep, add me to a tc with just this script and ill see if I can help.

0

Ok ,it's a blank world, I was making food items for my client

0

We have to be friends first so I sent u a friend request

This discussion is preserved as it was. New answers, comments, and votes are closed.