I get this error "Did you forget a colon? The first argument of member function SetAsync must be an Object"
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("MoneySaveSystem")
game.Players.PlayerAdded:connect(function(player)
local Money = Instance.new("IntValue",player)
Money.Name = "Money"
Money.Value = ds:GetAsync(player.UserId) or 0
ds:SetAsync(player.UserId, Money.Value)
Money.Changed:connect(function()
ds.SetAsync(player.UserId, Money.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds.SetAsync(player.UserId, player.Money.Value)
end)

1 comment
Firstly, it is supposed to be called with a colon, not a dot. [line 10 and 15]. Also, the first argument must be a string. Rather than player.UserId, put: tostring(player.UserId)