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

How do I fix an error that doesn't seem to actually break anything?

Asked by 4 years ago

Alright, so I've got an interesting issue. The script and animations actually work just fine, and everything does what it's supposed to. However, every time I fire the gun this is for, this error pops up despite everything working fine. 18:14:32.032 - LoadAnimation requires an Animation object

Here's the script:

game.ReplicatedStorage.Equipped.OnServerEvent:Connect(function(player, animation)
    local newAnim = game.Workspace[player.Name].Humanoid:LoadAnimation(animation)
        newAnim:Play()
        game.ReplicatedStorage.Unequipped.OnServerEvent:Connect(function()
            newAnim:Stop()
    end)
end)

game.ReplicatedStorage.Fire.OnServerEvent:Connect(function(player, animation)
    local fireAnim = game.Workspace[player.Name].Humanoid:LoadAnimation(animation)
    script.Parent.Handle.FireSound:Play()
    fireAnim:Play()
end)

game.ReplicatedStorage.Reload.OnServerEvent:Connect(function(player, animation)
    local reloadAnim = game.Workspace[player.Name].Humanoid:LoadAnimation(animation)
    script.Parent.Handle.ReloadSound:Play()
    reloadAnim:Play()
end)

This error is incredibly annoying to deal with, and just generally makes the gun feel like it's broken somehow. Thanks!

0
Does this error affect other clients from seeing the animation? beeswithstingerss 41 — 4y
0
Check out the animation for the gun. It seems to not exist, as it says it requires a animation object in order to load it. User#27525 1 — 4y
0
It seems to affect everyone, including the local client. Interestingly, the animations still show up in Studio. zhendirez 2 — 4y

Answer this question