I’m making a tool that change player local animation when he equip, but I have a issue when a trade a tool for another tool. That active both animate and tool animation.
local Players = game:GetService('Players')
local Player = Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local hum = char:WaitForChild('Humanoid')
local tool = script.Parent
tool.Equipped:Connect(function()
for i, v in char:GetChildren() do
if v:IsA("LocalScript") then
v.Enabled = false
end
end
task.wait()
char:WaitForChild("Shades").Enabled = true
game.ReplicatedStorage.Remotes.MaskEvent:FireServer()
end)
tool.Unequipped:Connect(function()
for i, v in char:GetChildren() do
if v:IsA("LocalScript") then
v.Enabled = false
end
end
task.wait()
char:WaitForChild("Animate").Enabled = true
game.ReplicatedStorage.Remotes.MaskEventOff:FireServer()
hum.WalkSpeed = 16
end)