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

How do I stop the animation when the tool is unequipped?

Asked by 5 years ago
Edited 5 years ago
01local Player = game:GetService("Players").LocalPlayer
02---
03local Tool = script.Parent
04---
05local Handle = Tool:WaitForChild("Handle")
06--
07local Character = Player.Character or Player.CharacterAdded:Wait()
08--
09local Mouse = game.Players.LocalPlayer:GetMouse()
10--
11local Humanoid = Character:WaitForChild("Humanoid")
12--
13local Anim = Humanoid:LoadAnimation(script.Parent:WaitForChild("GunDownAnim"))
14 
15------
View all 50 lines...

Hello, I am trying to script a gundown script, this is a local script in a tool and it disables the scripts that lets the player shoot, but the issue is that the Animation isn't stopping when the tool is unequipped.

1 answer

Log in to vote
0
Answered by
IrishFix 124
5 years ago

Im not entirely sure but in the parameters of the anim:Stop() you could put a fade time to make sure it does it, like:

Anim:Stop(0.5)

Hope i helped - Irish

Ad

Answer this question