[This might be in the wrong topic correct me if im wrong]
So if a player equips his sword and walks, the walking animation breaks.
wait()
-- Variables
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local WeaponStats = require(ReplicatedStorage:WaitForChild("WeaponStats"))
local DistanceModule = require(ReplicatedStorage:WaitForChild("DistanceModule"))
-- Player
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
-- Tool
local Tool = script.Parent
local AnimationsAction = Tool.ActionAnimations:GetDescendants()
local Sounds = Tool.Sounds:GetDescendants()
local EventBlock = Tool.BlockingEvent
local Event = Tool.Event
local IdleAnimation = Tool.IdleAnimation
local Equip = Humanoid:LoadAnimation(IdleAnimation)
Tool.Activated:Connect(function()
Tool.Event:FireServer(Player)
end)
Tool.Equipped:Connect(function()
Equip:Play()
end)
Tool.Unequipped:Connect(function()
Equip:Stop()
end)