If you don't want to help, don't help, for those who want to help; try your best :), and if you can't dont leave an answer.
#Problem
It's supposed to work like a normal datastore, but obviously things never work for me so there was something wrong; When my friend joined, i saw his old datastore go to his for a split second and then it went back to zero for a reason?
#Script
local DataStoreService = game:GetService("DataStoreService")
local StatsData = DataStoreService:GetDataStore("Savers")
local key = "Player_"
game.Players.PlayerAdded:Connect(function(player)
local sucess, errormessage = pcall(function()
local retrievedData = StatsData:GetAsync(key .. player.UserId)
local leaderstats = player.leaderstats
leaderstats.Cash.Value = retrievedData[1]
leaderstats.Power.Value = retrievedData[2]
leaderstats.Rebirths.Value = retrievedData[3]
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
local leaderstats = player.leaderstats
local sucess, errormessage = pcall(function()
StatsData:SetAsync(key .. player.UserId, {leaderstats.Cash.Value, leaderstats.Power.Value, leaderstats.Rebirths.Value})
end)
if sucess then
print("Was a succesfull data store!")
else
warn(errormessage)
end
end)

2 comments
Try using a loop; this article may help you: https://developer.roblox.com/en-us/articles/Saving-Player-Data
Why does people downvote this. She did nothing boi