I am trying to load an animation, and store it in a variable. I have looked at the roblox api, and based on what I see on that webpage, my code should work. My code is here:
game.ReplicatedStorage.RemoteEvents2.Spells.ignis.OnServerEvent:Connect(function(player)
local loadedAnimation = player.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.MelAnim.INC.AnimationId)
loadedAnimation:Play()
print("PLAYING")
end)
As you can see, this should work (the directories are correct, but you will just have to take my word for that).
If there is something that I am missing, I would appreciate being told so. Otherwise, I am out of luck.
Happy scripting, and all help is welcomed.
Edit: Does the same thing if I combine the two lines:
game.ReplicatedStorage.RemoteEvents2.Spells.ignis.OnServerEvent:Connect(function(player)
player.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.MelAnim.INC.AnimationId):Play()
print("PLAYING")
end)

1 comment
I am working with junior scripters, so they are of little help.