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

Animation run via script on mouse click?

Asked by 8 years ago
Edited 8 years ago

Not quite sure what is wrong with my script.

local Tool = script.Parent
local Player = game.Players.LocalPlayer
local animation = script.Parent.Animation

Tool.Equipped:connect(function(Mouse)
    Mouse.Button1Down:connect(function()
        local animTrack = Player.Humanoid:LoadAnimation(animation)
        animTrack:Play()
    end)
end)

It's supposed to make the animation play when the mouse is clicked, but that's not working. Can anyone help me?

0
Still in need of help. Suffixed 0 — 8y

Answer this question