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?
I basically think your friend did a typo. Here is the line:
mouse.Button1Down(connect(function()
I think it's gotta be instead:
MouseButton1Down:connect(function()
Hope this helped!