My problem is I am passing a remote event from a localscript into a serversided script so I can get the humanoid without any errors. The problem is, is when I try and load an animation into the humanoid on click it doesn’t work. Here is what I have coded.
local Clicking = script.Parent
local Clicks = Clicking.Clicks
local ClickingRem = game.ReplicatedStorage.Clicking
local Player = game.Players.LocalPlayer
local leaderstats = game.Players.LocalPlayer.leaderstats.Bucks
local Character = Player.Character
local Humanoid = Character:FindFirstChild(“Humanoid”)
Clicks.MouseButton1Click:Connect(function(hit)
ClickingRem:FireServer(Humanoid,leaderstats)
end)
-- Server Script
game.ReplicatedStorage.Clicking.OnServerEvent:Connect(function(plr,Humanoid,leaderstats)
leaderstats.Value = leaderstats.Value + 1
local FinalAnim = Humanoid:LoadAnimation(game.Workspace.TossingMoney)
FinalAnim:Play()
Have you tried checking if some other script is removing “TossingMoney”? If not, I would advise trying this so it won’t throw the error. The downside is it might not work. But maybe that narrows our reasons why this won’t work.
if workspace:FindFirstChild("TossingMoney") then
local FinalAnim = Humanoid:LoadAnimation(game.Workspace.TossingMoney)
FinalAnim:Play()
end