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

Dance Animation Help?

Asked by 10 years ago

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?

0
Did you create an animation and a tool for this script to use? If you did, did you receive an output? FearMeIAmLag 1161 — 10y
0
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 phoenixroby 0 — 10y
0
Make sure the actual animation is uploaded to ROBLOX, as the local copy tends not to work. OniiCh_n 410 — 10y

1 answer

Log in to vote
0
Answered by 6 years ago

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!

0
Oh dammit, date... radzik9988 -7 — 6y
Ad

Answer this question