I want to make a sword with an idle animation. I tried with this:
local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=1776614601"
moving=false Humanoid.Running:connect(function(value) if value>0 then moving=true else moving=false end)
while wait() do if not moving then end end
How do I do It?
tool = script.Parent tool.Equipped:Connect(function() if not tool.Parent:isA("Backpack") then local char = tool.Parent local humanoid = char:FindFirstChild("Humanoid") local animate = char:FindFirstChild("Animate") if humanoid and animate and animate:FindFirstChild("idle") then local idle1 = animate.idle:WaitForChild("Animation1") local idle2 = animate.idle:WaitForChild("Animation2") local default1 = idle1.AnimationId local default2 = idle2.AnimationId idle1.AnimationId = "http://www.roblox.com/Asset?ID=1776614601" idle2.AnimationId = "http://www.roblox.com/Asset?ID=1776614601" tool.Unequipped:Connect(function() local ActiveTracks = humanoid:GetPlayingAnimationTracks() for _,v in pairs(ActiveTracks) do v:Stop() end idle1.AnimationId = default1 idle2.AnimationId = default2 end) end end end)