Hey, I'm creating a Roblox dance club, and am trying to figure out how to put a dance animation in a hopperbin. I used this script which I got from my friend.
Tool = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character ~= nil
local hum = player.Character:WaitForChild("Humanoid")
local animation = Tool.DanceAnim --Change DanceAnim to the name of your animation.
local AnimTrack = hum:LoadAnimation(animation) --Loads the animation into the humanoid.
Tool.Selected:connect(function(mouse) --If you're using a tool, change Selected to Activated, and get rid of the code on the next line. Otherwise, keep this the same.
mouse.Button1Down(connect(function() --As mentioned above, delete this line if you're using a tool.
AnimTrack:Play()
end)
end)
Tool.Deselected:connect(function() --If you're using a tool, change Deselected to Unequipped. Otherwise keep it the same.
AnimTrack:Stop()
end)
I followed all the instructions and put it in a local script. It didn't work. Help?

3 comments
Did you create an animation and a tool for this script to use? If you did, did you receive an output?
I created an animation and put the script and animation in a hopperbin. After THAT didn't work, I tried changing Tool.DanceAnim to the name of my tool.danceanim then I tried changing tool to "hopperbin" no luck
Make sure the actual animation is uploaded to ROBLOX, as the local copy tends not to work.