How can I make this animation on this tool a Click animation on a mouse?
Asked by
7 years ago Edited 7 years ago
So here is the script:
01 | local animation = Instance.new( "Animation" ) |
04 | local trackanimation = nil |
05 | local playability = true |
06 | function playAnimation(AnimationSource) |
07 | if playability = = true then |
08 | local plr = game.Players.LocalPlayer |
09 | trackanimation = plr.Character.Humanoid:LoadAnimation(animation) |
11 | trackanimation.KeyframeReached:connect( function () |
18 | local Player = game.Players.LocalPlayer |
19 | local Mouse = Player:GetMouse() |
20 | local waituntilback = script.Parent.Parent.Tool.Equipped:connect() |
21 | script.Parent.Parent.Tool.Equipped:connect( function () |
22 | if not script.Parent.Parent.Tool.Equipped:connect() then |
23 | playAnimation(waituntilback) else |
But how do I make it where it shows up in the game and How do I make it where it's only a Mouse click. This script only when you pull out the tool it starts the animation.