-
Objective: I’m looking to have a tool with a custom idle animation and a custom animation when activated.
-
Problem: When trying to remove the animation with tool.Unequipped there is no animation removed.
-
What solutions have you tried so far? I tried looking at tutorials. However, they have proven themselves not being useful because they have the same or more issues.
local tool = script.Parent
local animationActivated = tool:WaitForChild("anihit")
local animationIdle = tool:WaitForChild("anihold")
tool.Equipped:Connect(function()
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local Humanoid = character.Humanoid
local playAnimation = Humanoid:LoadAnimation(animationIdle)
playAnimation:Play()
end)
tool.Activated:Connect(function()
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local Humanoid = character.Humanoid
local hitAnimation = Humanoid:LoadAnimation(animationActivated)
hitAnimation:Play()
end)
tool.Unequipped:Connect(function()
local player = game:GetService("Players").LocalPlayer
local character = player.Character
local Humanoid = character.Humanoid
local playAnimation = Humanoid:LoadAnimation(animationIdle)
playAnimation:Stop()
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.