Can anyone help me? Me and my partner have been searching for hours and we still dont have a solution. We need a idle animation script that plays when you equip a sertain tool. We have tried many diffrent scripts but none worked.
COMMUNITY QUESTION
We've been searching for hours how to make a Tool Idle Animation. Does anyone know how?
1 answer
local player = game.Players.LocalPlayer
repeat wait(1) until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.Name = "Idle"
animation.Parent = script.Parent
animation.AnimationId = "http://www.roblox.com/asset/?id=" .. "123456789"-- id
local animtrack = humanoid:LoadAnimation(animation)
script.Parent.Equipped:connect(function()
animtrack:Play()
end)
script.Parent.Unequipped:connect(function()
animtrack:Stop()
end)
put it in a local script and put the local script in the tool, however, the second you move it does not play anymore, you might have to play around with it. make sure to put your animation id in where there is a bunch of numbers.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Tool.Equipped:connect(function()animation:play)