I have a server script with the RunContext set to client, but this script isn’t working. I have another tool with this exact same script that works fine, but this one seems to not. The only thing in the dev console is “Attempt to index nil with :WaitForChild()”, but that doesn’t seem to matter since the other tool works fine.
local animation = script.Parent.Parent:WaitForChild("TabletAnimation")
local humanoid = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local track = animator:LoadAnimation(animation)
script.Parent.Parent.Equipped:Connect(function()
track:Play()
end)
script.Parent.Parent.Unequipped:Connect(function()
track:Stop()
end)
script.Parent.Parent.Destroying:Connect(function()
track:Stop()
end)