The animation I'm using for my tool works before respawning, but after that it won't play when i click. How would i fix this? (Sorry if it's obvious, i'm a beginner) The code:

local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
while char.Parent == nil do
	char.AncestryChanged:wait()
end
local h = char:WaitForChild("Humanoid")
local anim = h:LoadAnimation(script.Parent:WaitForChild("HalberdStab1"))

local tool = script.Parent

tool.Activated:Connect(function()
  anim:Play()
 end)

tool.Unequipped:Connect(function()
 anim:Stop()

end)

2 comments

0

I think you need to have the script in your character. Because once you die the script reloads

0

I have it in the starterpack