Hello, I am trying to make a script where if you activate a tool, it will make an animation play, but the animation does not seem to play, and I do not know why.
local mouse = game.Players.LocalPlayer:GetMouse()
local p = 0
local animation = game.ReplicatedFirst.Animation
local char = game.Players.LocalPlayer.CharacterAdded:Wait() or game.Players.LocalPlayer.Character
local humanoid = char:WaitForChild("Humanoid")
local animator = humanoid.Animator
local DownAnim = animator:LoadAnimation(animation)
tool.Activated:Connect(function()
p = p + 1
print(p)
local DownAnim = animator:LoadAnimation(animation)
DownAnim:Play()
end)```
This is in a local script that is in a tool. P exists because I am making a system where it sends a remote event to a server, but my main issue is that the animation won't play, do I use a different animation priority? I think I have it as a core animation right now, I tried using others but they don't work, "p" is equal to the correct thing but the animation just doesn't play, and i dont know why, can someone please help me?