So here is my module script and I'm trying to add coins to a datastore ok
CoinData = game:GetService('DataStoreService'):GetDataStore('Coins')
function AddCoins(plr, toadd)
print(plr)
if CoinData:GetAsync(plr) then
CoinData:IncrecementAsync(plr, toadd)
print(CoinData:GetAsync(plr))
end
end
return AddCoins
But when I call the function from a script..
a = require(game.ServerScriptService.AddCoins)() AddCoins('Trolna', 100)
I get slapped with
08:30:39.775 - Argument 1 missing or nil
08:30:39.775 - Stack Begin
08:30:39.775 - Script 'ServerScriptService.AddCoins', Line 4
08:30:39.776 - Script 'a = require(game.ServerScriptService.AddCoins)() AddCoins('Trolna', 100)', Line 1
08:30:39.776 - Stack End
halp
