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

Why doesn't my sword animation work when anybody but me uses the sword?

Asked by 7 years ago
Edited 7 years ago

For some reason, my sword animation that I made only works on me. When I ask a friend to test it on their character, it doesn't function and in the output it says cannot load animation.

I used a local script for the animation and I put an animation item in the local script. The local script is:

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(3)
        attack:Stop()
        CanAttack = true
        script.Parent.CanDamage.Value = true
    end
end)

(There is also a boolvalue in the sword tool set to true)

So could someone give me a solution, that would be much appreciated.

0
Is Your Game Fe? Prestory 1395 — 7y
0
Yes thextreme851 0 — 7y
1
Did you have your friend test it by giving the tool to them as a model? If you did, then it won't work. Animations can only be used by its publisher. XAXA 1569 — 7y
0
It wasn't a model as the sword parts weren't grouped together. All the parts were in a tool item in replicated storage. To use the sword, you have to buy it from a shop and it appears in the users inventory and does damage, but the animation unfortunately doesn't work thextreme851 0 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

I'm no expert, but if you're using LocalScript, change it to Script ! LocalScripts work for player themselves, but Scripts work gamewide ! (You have rights to judge me, since I don't know it all completely)

0
I've tried that before and again it doesn't work. It just comes up with the same error message :( thextreme851 0 — 7y
0
Alright, then I'm out of ideas,sorry... LordTechet 53 — 7y
Ad

Answer this question