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

Help with my punch tool animation (not working at all)?

local player = game.Players.LocalPlayer
local char = player.CharacterAdded:Wait()

script.Parent.Equipped:Connect(function()
	local animation = char.Humanoid:LoadAnimation(script.Parent.Animation)
	animation.Priority = Enum.AnimationPriority.Action
	
	animation:Play()
	print("yo")
end)

I will edit this part later, need to do something

1 comment

0

Verify that it is detecting your CharacterAdded

2 answers

Just a few recommendations and reminders for you that may fix the code if you still need help. The first is line 2; consider replacing line 2 with this:

repeat wait() until player.Character
local char = player.Character

That will completely pause the script until the char is found.

In addition make sure the animation joints match with the character joints. An r6 anim won't work on an r15 and vise-versa.

I hope this helps. Till next time

Instead of doing it through a script, try changing the animation priority through the animation editor. (3 dots > Set Animation Priority > Action).

1 comment

0

Thanks, it did help me but the answer above did more. You earned yourself an upvote :)

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