local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("StageSaveSystem")
game.Players.PlayerAdded:connect(function(plr)
local ls = Instance.new("Folder", plr)
ls.Name = "leaderstats"
local st = Instance.new("StringValue")
st.Name = "Stage"
st.Parent = ls
st.Value = 0
st.Value = ds1:GetAsync(plr.UserId) or 0
ds1:SetAsync(plr.UserId, st.Value)
st.Changed:connect(function()
ds1:SetAsync(plr.UserId, st.Value)
end)
end)
--[[ game.Players.PlayerRemoving:Connect(function(Player)
ds1:SetAsync(Player.UserId,Player.leaderstats["Stage"].Value) ]]
How do i add the above^^ so it saves when someone leaves instead of saving everytime the stage.value changes? Just wanna change it because of after 30 requests of changing the stage.value the rest will be dropped and will not save.

2 comments
Not a request site.Would Downvote but i can't :(
how is this a request, i just need help, something that should be pretty simple to do but when i tried it, it just removed the stages.