Hello I’m writing a script for my gun and this hold anim
But Animation:Stop() not working
function OnUnequipped()
if FPSHandsEnbled then
local Rig = DetectRigAsync(MyCharacter)
if Rig == "R15" then
local WhitelistedBodyParts = {"LeftHand", "LeftLowerArm", "LeftUpperArm", "RightHand", "RightLowerArm", "RightUpperArm"}
for i, v in pairs(WhitelistedBodyParts) do
TransparencyConnections[v]:Disconnect()
TransparencyConnections[v] = nil
end
elseif Rig == "R6" then
local WhitelistedBodyParts = {"Right Arm", "Left Arm"}
for i, v in pairs(WhitelistedBodyParts) do
TransparencyConnections[v]:Disconnect()
TransparencyConnections[v] = nil
end
end
if AutoFirstPerson then
MyPlayer.CameraMode = Enum.CameraMode.Classic
MyPlayer.CameraMinZoomDistance = 9.6
task.wait(0.02)
MyPlayer.CameraMinZoomDistance = game:GetService("StarterPlayer").CameraMinZoomDistance
end
end
Handle.UnequipSound:Play()
Handle.EquipSound:Stop()
Handle.EquipSound2:Stop()
local Equip = MyHumanoid:LoadAnimation(script.Parent.Equip)
LeftButtonDown = false
flare.MuzzleFlash.Enabled = true
Reloading = false
MyCharacter = nil
MyHumanoid = nil
MyTorso = nil
MyPlayer = nil
MyMouse = nil
Equip:Stop(0)
if OnFireConnection then
OnFireConnection:disconnect()
end
if OnReloadConnection then
OnReloadConnection:disconnect()
end
if FlashHolder then
FlashHolder = nil
end
if WeaponGui then
WeaponGui.Parent = nil
WeaponGui = nil
end
if RecoilTrack then
RecoilTrack:Stop()
end
if ReloadTrack then
ReloadTrack:Stop()
end
end
Here is uneqquip code part