So this is my current datastore but roblox datastore services go down a lot / There is a big limit to how much data can save this how can i make this more reliable
local DataStoreService = game:GetService("DataStoreService")
local MyDataStore = DataStoreService:GetDataStore("DataStore")
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local Cash = Instance.new("NumberValue",leaderstats)
Cash.Name = "Coins"
local data
local Success,Errormessage = pcall(function()
data = MyDataStore:GetAsync(player.UserId.."-Cash")
end)
if Success then
Cash.Value = data
else
print("Error Getting Ur Data")
warn(Errormessage)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local Success , ErrorMessage = pcall(function()
MyDataStore:SetAsync(player.UserId.."-Cash",player.leaderstats.Coins.Value)
end)
if Success then
print("Players Data Was Saved")
else
print("There was a error loading the data")
warn(error)
end
end)
