Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This animation script won't run, and I can't find the error?

Asked by 4 years ago
local Idle1 = script.Parent:WaitForChild("Idle")
local Swing1 = script.Parent:WaitForChild("Swing_1")
local Swing2 = script.Parent:WaitForChild("Swing_2")
local Swing3 = script.Parent:WaitForChild("Swing_3")
local Player = game:GetService("Players"):WaitForChild("LocalPlayer")
local Hum = Player.Character:WaitForChild("Humanoid")
local IdleL = Hum:LoadAnimation(Swing3)
local Equipped = false

script.Parent.Equipped:Connect(function()
    Equipped = true
    IdleL:Play()
end)

script.Parent.Unequipped:Connect(function()
    Equipped = false
    IdleL:Stop()
end)

I've ensured that the animations for the weapon are correct as well. Perhaps I have the ID's wrong if no one can figure something out.

Answer this question