Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can others use my animations in my game?

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.

2 comments

0

Animations only work for one player / the one who created it

0

Is there another way I can create custom animations then?

2 answers

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:

  1. 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.

  2. Publish the model you were animating that has the save, and give it to your brother.

  3. 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.

  4. 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)

5 comments

0

Still not working. It says that the link is invalid.

0

You have to export the animation from the animation editor, then go in your inventory and copy the ID, and paste it where i said idhere

0

I did that, this is the animation ID: https://www.roblox.com/library/1231217481/Sword-Swing-2-0 and I replaced the "idhere" with 1231217481.

0

is it in a localscript?

0

Yup.

This discussion is preserved as it was. New answers, comments, and votes are closed.