Getting this error in output

Getting this error in the output. Don’t know what it means.

My code:

game.ReplicatedStorage.Remotes.Add.OnServerEvent:Connect(function(player, amount)
	local currency = 'Money'
	player.leaderstats[currency].Value = player.leaderstats[currency].Value + amount

I would appreciate if someone would be able to help me fix this. Please let me know.

Try printing amount and see what prints.

1 Like

Hi, thank you for the help. I ended up fixing the error while I was waiting for a response.

1 Like

I know this is solved but it is very important to understand output errors, basically what the output explains to you is that you are trying to add a number to a nil variable (something that doesn’t exist and is not a number)