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

Animation does not play when I have a weapon in hand?

I have an animation called "Anime" that moves the player's Right Arm. When I play the animation, it works fine. However, when I play it when a sword is equipped in the player's right hand, the animation does not play. No output or anything.

script.Parent.MouseButton1Click:connect(function()
	Anime = script.Parent.Anime
	Anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Anime)
	Anim:Play()
end)

This is inside a GUI button inside a sword.

I'm totally baffled.

4 comments

0

How do you have a sword in your left hand?

0

*right

0

I think the problem is most likely that the Sword plays an Animation when you are holding it, and I don't think you can play two Animations at once.

0

The sword I am using is just a Tool with a sword mesh as the Handle. It has none of the original scripts in it that let you click to attack.

1 answer

I think it has to deal with Lines 3 & 4.

script.Parent.MouseButton1Click:connect(function()
Anime = script.Parent.Anime
Anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Anime) --Anim?
Anim:Play() --Anim?
end)

1 comment

0

I'm not sure what you are pointing out. Anim is defined at line 3, and it is played at line 4.

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