This is my module script, I would like to have one place where I can give players points that way I can notify them when they recieve it without needing to add the remote event and the cash adding stuff every time. This won't work though and I'm not sure why.
local cAdd = game.ReplicatedStorage.Remotes.CashAdd
local mod = {}
mod.addPts = function(plr,amt)
plr:FindFirstChild("leaderstats").Points.Value = plr:FindFirstChild("leaderstats").Points.Value + amt
cAdd:FireClient(plr)
end
return mod
Error
12:49:02.237 - ServerScriptService.Mod:6: attempt to call method 'FindFirstChild' (a nil value)
12:49:02.237 - Stack Begin
12:49:02.237 - Script 'ServerScriptService.Mod', Line 6 - method addPts
12:49:02.238 - Script 'ServerScriptService.Remotes', Line 11
12:49:02.238 - Stack End
^ leaderstats does exsist in the player when this is called, the player also exsists

2 comments
did you pass player as an argument?
Show how you call the function