With the help of dev forums and my own knowledge I have this script that will equip entire different animations when you hold a tool, when making this I noticed that when you stop walking you the idle for the sword won’t come back, instead it just gives regular animations. Is there a way for me to check if the player stopped walking, then check if there still holding the tool and make it select my idle? here is my code
local remoteEvent = ReplicatedStorage:WaitForChild("StoppedWalking")
remoteEvent:FireServer()
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local h = char:WaitForChild("Humanoid")
local Idle = Instance.new("Animation")
Idle.AnimationId = "rbxassetid://7241020438"
local animIdle = h:LoadAnimation(Idle)
animIdle.Looped = true
animIdle.Priority = Enum.AnimationPriority.Idle
local Equip = Instance.new("Animation")
Equip.AnimationId = "rbxassetid://7245238821"
local animEquip = h:LoadAnimation(Equip)
animEquip.Looped = true
animEquip.Priority = Enum.AnimationPriority.Action
local DesEquip = Instance.new("Animation")
DesEquip.AnimationId = "rbxassetid://023032023"
local animDesEquip = h:LoadAnimation(DesEquip)
animDesEquip.Looped = true
animDesEquip.Priority = Enum.AnimationPriority.Action
local ChangeKey = Instance.new("Animation")
ChangeKey.AnimationId = "rbxassetid://023032023"
local animChgKey = h:LoadAnimation(ChangeKey)
animChgKey.Looped = true
animChgKey.Priority = Enum.AnimationPriority.Action
-------------------------------------------------
local Mouse = plr:GetMouse()
local Tool = script.Parent
Tool.Equipped:Connect(function()
animEquip:Play()
wait(0.2)
animEquip:Stop()
animIdle:Play()
end)
Tool.Unequipped:Connect(function()
animDesEquip:Play()
animDesEquip:Stop()
animIdle:Stop()
end)
h.Running:Connect(function(speed)
if speed > 0 then
animIdle:Stop()
end
end)