Ok so I fixed everything you guys told me to do last time but there are no outputs and the datastore won't work I think I did everything right but it's still not working
Money is a int value in player
also I didn't put anything for player removing because I wanted to test if game Bind To close works
I tested this in studio and in game by my self
but it still doesn't return any errors on outputs or warnings literally nothing
and it doesn't save of course
local DataS = game:GetService("DataStoreService")
local DataStore = DataS:GetDataStore('Money')
game.Players.PlayerAdded:Connect(function(plr)
local IntValue = Instance.new("IntValue")
IntValue.Name = 'Money'
IntValue.Parent = plr
IntValue.Value = DataStore:GetAsync(plr.UserId,IntValue.Value) or 0
DataStore:SetAsync(plr.UserId,IntValue.Value)
end)
game.Players.PlayerRemoving:Connect(function(plr)
end)
game:BindToClose(function()
for i,v in pairs(game.Players:GetPlayers()) do
DataStore:SetAsync(v.UserId,v.Money.Value)
end
end)
