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

Why is the Animation Id failing to load?

Asked by
DesertusX 435 Moderation Voter
4 years ago
Edited 4 years ago

I tried making keybind animations. They work just fine aside the error:

AnimationId failed to load

or something.

Here's the script:

local rs = game:GetService("ReplicatedStorage")

local e1 = rs.Move1Play
local e2 = rs.Move2Play
local e3 = rs.Move3Play
local e4 = rs.Move4Play

local id1 = workspace.MoveId1 -- The value is 4951461649
local id2 = workspace.MoveId2 -- The value is 4951461649
local id3 = workspace.MoveId3 -- The value is 4946579253
local id4 = workspace.MoveId4 -- The value is 4946579253



do

local function play1(plr)

    local char = plr.Character or plr.CharacterAdded:Wait()
    local h = char:FindFirstChild("Humanoid")

    local anim = Instance.new("Animation")

    if id1.Value then
    anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id1.Value)
    end

    local track = h:LoadAnimation(anim)
    track:Play()

    end

            e1.OnServerEvent:Connect(play1)

end


do

local function play2(plr)

    local char = plr.Character or plr.CharacterAdded:Wait()
    local h = char:FindFirstChild("Humanoid")

    local anim = Instance.new("Animation")

    if id2.Value then
    anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id2.Value)
    end

    local track = h:LoadAnimation(anim)
    track:Play()

    end

        e2.OnServerEvent:Connect(play2)

end


do

local function play3(plr)

    local char = plr.Character or plr.CharacterAdded:Wait()
    local h = char:FindFirstChild("Humanoid")

    local anim = Instance.new("Animation")

    if id3.Value then
    anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id3.Value)
    end

    local track = h:LoadAnimation(anim)
    track:Play()

    end

        e3.OnServerEvent:Connect(play3)

end


do

local function play4(plr)

    local char = plr.Character or plr.CharacterAdded:Wait()
    local h = char:FindFirstChild("Humanoid")

    local anim = Instance.new("Animation")

    if id4.Value then
    anim.AnimationId = "http://www.roblox.com/asset/?id=" .. tostring(id4.Value)
    end

    local track = h:LoadAnimation(anim)
    track:Play()

    end

        e4.OnServerEvent:Connect(play4)

end
1
No need to make 3 functions for practically the same operation. I can't really tell what is happening since I haven't an idea as to how those ids actually look, but it seems Roblox is failing to load your ids. So, if I were you, I would make a table of all those ids and set anim.AnimationId equal to each table using a for loop. IdealistDeveloper 234 — 4y
1
Also, no need to use that 'do' statement either. IdealistDeveloper 234 — 4y
0
Any ideas on how to fix it though? DesertusX 435 — 4y
0
Those are the values. DesertusX 435 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

Use rbxassetid:// when using the animation.

0
Thank you so much! DesertusX 435 — 4y
0
sure! User#29913 36 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

You either haven’t made a GUI or didn’t put it in the GUI. If you haven’t made a GUI then the animation won’t work for reasons that can be answered easily.

0
why would i need a gui? DesertusX 435 — 4y
0
So they can use the animation. As I said it’s self explanatory. sealzrcool 6 — 4y
0
Why do they need a GUI to use the animation? DesertusX 435 — 4y

Answer this question