I have a script where I want the tool to activate, play an animation and then give the player money.
I have a RemoteEvent called 'Money' in ReplicatedStorage and am firing it from the following local script:
*local Amount = 5
script.Parent.Activated:connect(function()
if script.Parent.Used.Value == true then
else
script.Parent.Used.Value = true
local hum = game.Players.LocalPlayer.Character.Humanoid
local anim_feet = hum:LoadAnimation(script.Parent.Animation)
local current = anim_feet
current:Play()--How long until animation plays.
wait(0.5)
game.ReplicatedStorage.Money:FireServer(Amount)
script.Parent.Used.Value = false
end
end)
*
I then have the Server Script in ServerScriptService:
*local function onMoneyFired(Player,Amount)
Player.leaderstats.Money.Value = Player.leaderstats.Money.Value + Amount
end
game.ReplicatedStorage.Money.OnServerEvent:Connect(function(onMoneyFired)
print("Fired")
end)*
My problem is the animation plays but none of the server script works. I have checked all over the internet for a solution but I cant find anything. I do receive the 'Fired' that I print in the bottom of the server script but nothing happens after that.

1 comment
the thing you messed up is you used (function(onMoneyFired) instead of (onMoneyFired)