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

Animation Problems. Any help?

Asked by 9 years ago

I have a brick that when you touch it it clones this script into you along with a 'dance' animation. Then the script runs and you dance! The only problem is that the script works fine when in Studio testing it but it doesn't work playing it with in game. Here is the code

local player = script.Parent
local animFile = player:FindFirstChild("dance")

local anim = player.Humanoid:LoadAnimation(animFile)

anim:Play()

wait(3.5)

anim:Stop()
animFile:remove()
anim:remove()
script:remove()

The error reads:

Argument error: must be an Animation object Script. 'Workspace.jcbh.DanceScript', Line 4 Stack End

I'm clueless, any help?

Answer this question