I made a script for an axe that swings (animation only no damage) and has an Idle stance when standing still. Everything works except for the idle animation. I don't know what's wrong. I'm a bit of a beginner. This is all in a local script
wait(5)
tool = script.Parent
local player = game.Players.LocalPlayer
local hum = player.Character.Humanoid
local anim1 = Instance.new("Animation")
anim1.AnimationId = "rbxassetid://7253655066"
local stance = hum:LoadAnimation(anim1)
local ten = true
local swinging = false
local en = true
local on = 1
local anim2 = Instance.new("Animation")
anim2.AnimationId = "rbxassetid://7260872928"
local axe1 = hum:LoadAnimation(anim2)
local anim3 = Instance.new("Animation")
anim3.AnimationId = "rbxassetid://7264662836"
local axe2 = hum:LoadAnimation(anim3)
local anim4 = Instance.new("Animation")
anim4.AnimationId = "rbxassetid://7264665302"
local axe3 = hum:LoadAnimation(anim4)
while tool.Equipped == true and hum.MoveDirection.Magnitude == 0 do
stance:Play()
stance.Looped = true
if hum.MoveDirection.Magnitude > 0 then
stance:Stop()
end
end
tool.Activated:Connect(function()
if en == false then return end
en = false
local char = tool.Parent
local hum = char.Humanoid
local anim = hum:LoadAnimation (tool.Handle ["Animation"..on]) -- Animation 1 or Animation 2
anim:Play()
swinging = true
ten = true
wait(0.4)
swinging = false
on = on + 1
if on >= 4 then
on = 1
wait(1)
end
en = true
end)

1 comment
wtf is this?