local tool = script.Parent
local animFolder = tool.Animations
local holdAnimation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animFolder.HoldAnimation)
tool.Equipped:Connect(function()
holdAnimation:Play()
end)
That’s because the Character doesn’t exist yet.
You can simply do:
local Player = game:GetService("Players").LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local holdAnimation = Character.Humanoid:LoadAnimation(animFolder.HoldAnimation)
I forgot of the CharacterAdded event fires before the humanoid is added or after the humanoid is added.
If it’s before, then you should also create a seperate variable for humanoid where you use :WaitForChild() like this:
local Character = -- this is the same as the above reply
local Humanoid = Character:WaitForChild("Humanoid")
local holdAnimation = Humanoid:LoadAnimation(animFolder.HoldAnimation)
It was probably just a race condition. If the character was loaded before the tools were cloned into your backpack it would have worked, if not it’d error.