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

Animation not playing?

Asked by 8 years ago

This script is inside a Sword tool, two animations are inside the script. When the script attempts to play either one of them, it says "--Content failed because HTTP 403 (HTTP/1.1 403 Forbidden) --Animation failed to load : Workspace.Toadboyblue.Sword.Script.RightSwipe --Object must be in Workspace before loading animation."

This is the script:

local sword = script.Parent
local blade = script.Parent.Handle
local duringswing = false
local Ani1 = game.Workspace.RightSwipe
local Ani2 = game.Workspace.LeftSwipe
local last = 2
local midswing = false
sword.Activated:connect(function()
    local Me = script.Parent.Parent:FindFirstChild("Humanoid")
        if midswing == false then
            duringswing = true
            midswing = true
            if last == 1 then
                last = 2
                animTrack = Me:LoadAnimation(Ani2)
            else
                last = 1
                animTrack = Me:LoadAnimation(Ani1)
            end
            animTrack:Play()
        end
        wait(0.7)
        midswing = false
        duringswing = false
end)

Please excuse the excess lines, I wanted to put in the entire script as it was.

1 answer

Log in to vote
0
Answered by 8 years ago

I solved this myself, so if anyone else is wondering how to fix this; use a LocalScript.

Ad

Answer this question