How does the Mouse Button1Down event work?
I just created the following script:
02 | local animation = Instance.new( "Animation" ) |
07 | MyMouse.Button 1 Down:connect(playAnim) |
13 | function playAnim(Source) |
15 | local player = script.Parent.Parent |
17 | animTrack = player.Humanoid:LoadAnimation(animation) |
But it gives me the following Error:
18:32:57.308 - Workspace.Player1.ID [C5].Script:20: attempt to index global 'mouse' (a nil value)
18:32:57.310 - Script 'Workspace.Player1.ID [C5].Script', Line 20
18:32:57.310 - stack end
How can I fix it. Please note the following:
-This is a tool
-This is supposed to run an Animation in the Humanoid. It works perfectly without MouseClicks