this is my script
------------------< variables >----------------
local uis = game:GetService("UserInputService")
local saber = script.Parent
local p = game.Players.LocalPlayer
local l = p.leaderstats
local equipped = false
local textBox = game.StarterGui.Strenght.TextLabel
local anim = script.Parent:WaitForChild("SwingAnimation")
------------------< code >---------------------
saber.Equipped:Connect(function()
equipped = true
end)
saber.Unequipped:Connect(function()
equipped = false
end)
uis.InputBegan:Connect(function(input1)
local mouseIn1 = input1.UserInputType
if equipped == true and mouseIn1 == Enum.UserInputType.MouseButton1 then
l.Strenght.Value = l.Strenght.Value + 5
local loadedAnim = p.Character.Humanoid:LoadAnimation(anim)
loadedAnim:Play()
end
end)
it's a local script and it's parented to a tool. all the parts work, exept the animation part. what did i do wrong?

2 comments
It should work. Are there any errors?
ummm yeah it says that the animation variable is a nil value