If i made a simulator game where you gain points.What if for one player lost all his progress on the game made by me is gone?Is there a script because i don t want to make a button to save progress on the game.That would be weird.
Can someone help me?
what you have to do is first you have to make a variable called datastore like this
--save script
local datastore = game:GetService("DataStoreService"):GetDataStore("yeet") game.Players.PlayerRemoving:Connect(function(leaver) datastore:SetAsync("player_"..leaver.userId,enter here your'e value) end)
-- load script put in leaderstats
local key = "player_"..ThatOne.UserId -- gets UserId local getsave = datastore:getAsync(key) your value here.Value = getsave this is the script