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

How can others use my animations in my game?

Asked by 6 years ago

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.

0
Animations only work for one player / the one who created it abnotaddable 920 — 6y
0
Is there another way I can create custom animations then? xXMegaVitonesXx 5 — 6y

2 answers

Log in to vote
1
Answered by
mattscy 3725 Moderation Voter Community Moderator
6 years ago

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.

Ad
Log in to vote
0
Answered by
oSyM8V3N 429 Moderation Voter
6 years ago
Edited 6 years ago

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)
0
Still not working. It says that the link is invalid. xXMegaVitonesXx 5 — 6y
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 oSyM8V3N 429 — 6y
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. xXMegaVitonesXx 5 — 6y
0
is it in a localscript? oSyM8V3N 429 — 6y
0
Yup. xXMegaVitonesXx 5 — 6y

Answer this question