Animation not runnning

Hello.

I’ve got two Animations.

Code:

local RS = game:GetService('ReplicatedStorage')
local Plr = game.Players.LocalPlayer
repeat wait() until Plr.Character:FindFirstChild('Torso')
local Char = Plr.Character
local WeaponTool = script.Parent
local Safety = false

local ReadySt,SafetySt 

local UIS = game:GetService('UserInputService')

script.Parent.Equipped:Connect(function()
	
	RS.ConnectM6D:FireServer(WeaponTool.BodyAttach)
	
	Char.Torso.ToolGrip.Part0 = Char.Torso
	Char.Torso.ToolGrip.Part1 = WeaponTool.BodyAttach
	
	local Humanoid = WeaponTool.Parent:FindFirstChild('Humanoid')
	
	if Humanoid then
		ReadySt = Humanoid:LoadAnimation(WeaponTool.ReadyStance)
		SafetySt = Humanoid:LoadAnimation(WeaponTool.SafetyStance)
		if not Safety then
			SafetySt:Stop()
			ReadySt:Play()
		elseif Safety then
			ReadySt:Stop()
			SafetySt:Play()
		end
		--ReadySt:Play()
		UIS.InputBegan:Connect(function(Input, GameProc)
			if not GameProc then
				
				if Input.KeyCode == Enum.KeyCode.F then
					print('F has been pressed')
					if not Safety then
						print('Safety On')
						Safety = true
						ReadySt:Stop()
						SafetySt:Play()
					elseif Safety then
						print('Safety Off')
						Safety = false
						SafetySt:Stop()
						ReadySt:Play()
					end	
				end	
			end
		end)
	end
end)

WeaponTool.Unequipped:Connect(function()
	RS.DisconnectM6D:FireServer()
	ReadySt:Stop()
	SafetySt:Stop()
end)

Problem [Gyazo]:

https://gyazo.com/4009dd709ea61078689a415394a84f35

So, when I join the game, all works fine. The Animations switch perfectly when I press F. But when de equip the tool, then re equip it, when I press F, the animations wont run. Yet when I dequip and requip the tool again, when I press F, the animations work perfectly fine.
What is going on?

EDIT: Formatted Code

Can you send the code in text, not as a image? I can’t read it.

1 Like

Ok, so since it’s a tool you need to make sure that the animation Priority is an “Action”

Not a core or a movement or idle
nSR0xRl

So if you didn’t then Open “Animation Editor” and Import your animations and save them as Action priority.
Hope it helps.

3 Likes

Thanks a lot that worked for me!

1 Like