I'm new to scripting and I'm trying to make a game with my brother. We created a custom sword and I added an animation for it (following this tutorial: https://www.youtube.com/watch?v=dRGEAethTGA). When I test the sword, the animation works fine, but when my brother tries it the animations won't work and he receives this error message:
"Animation "https://www.roblox.com///asset/?id=1231217481&serverplaceid=0" failed to load in "Workspace.Eribetra.knife.LocalScript.Attack.AnimationId": Animation failed to load"
Is this error message going to show to everyone that doesn't have the animation? If so, how can I fix it?
My scripts for the sword:
local CanAttack = true script.Parent.Activated:connect(function() local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) if CanAttack == true then attack:Play() CanAttack = false wait(0.6) attack:Stop() CanAttack = true script.Parent.CanDamage.Value = true end end)
Thanks for your attention.
As far as I know, these are the only ways you can really do this:
-Use keyframing, although I wouldn't recommend this as it's deprecated.
-Make a group place with your brother and save the animation as a group animation. This way it will work for either of you in any group game you make
-This next way involves a few steps:
In the animation editor, open the desired animation and go file>save and save the animation. This should create a local copy of the animation that is inside the model you are animating.
Publish the model you were animating that has the save, and give it to your brother.
Your brother then inserts the model into his game and selects it with the animation editor, then goes to file>load to load the animation that is saved on that model.
He then exports this loaded animation as his own, allowing him to use it in his games.
Hope this helps.
The easiest solution i'm thinking about right now, is export your animation and load it through your inventory so that everyone can use it. So it should be shown like this :
local CanAttack = true local p = game.Players.LocalPlayer local animation = Instance.new("Animation") animation.AnimationId = "http://www.roblox.com/Asset?ID=1231217481" script.Parent.Activated:connect(function() local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) if CanAttack == true then local attack = p.Character.Humanoid:LoadAnimation(animation) attack:Play() CanAttack = false wait(0.6) attack:Stop() CanAttack = true script.Parent.CanDamage.Value = true end end)