local module = {}
local DataStore = game:GetService("DataStoreService"):GetDataStore("M12341123231")
local StarterPounds = 0
game.Players.PlayerAdded:connect(function(player) local Stats = Instance.new('Folder', player) Stats.Name = "Stats"
local Pounds = Instance.new('NumberValue', player)
Pounds.Name = "Pounds"
Pounds.Value = StarterPounds
Pounds.Parent = Stats
local SavedPounds = DataStore.GetAsync(player.UserId..'-Pounds')
if SavedPounds == nil then
Pounds.Value = SavedPounds
end
end)
game.Players.PlayerRemoving:connect(function(player) local id = player.UserId local PoundsValue = player.Stats.Pounds.Value DataStore:SetAsync(id..'-Pounds', PoundsValue) end) return module
Whenever I change the first argument I get UserId isn't a valid member of Player.~~~~~~~~~~~~~~~~~

3 comments
You do DataStore.GetAsync(DataStore, player.UserId..-'Pounds')
Or you can use syntax sugar and use DataStore:GetAsync(player.UserId..-'Pounds').
next time, don't use the parent parameter of Instance.new(), as that causes performance issues