Change Tool Animation Issue

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)

Just add task.wait() before disable the LocalScript.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.