my data doesnt save when i rejoin
this is in a seperate script from the leaderstats
local datastore = game:GetService("DataStoreService"):GetDataStore("SavaData")
game.Players.PlayerAdded:Connect(function(plr)
wait()
local plrid = "id_"..plr.UserId
local save1 = plr.leaderstats.Coins
local GetSaved = datastore:GetAsync(plrid)
if GetSaved then
save1.Value = GetSaved[1]
else
local NumberForSaving = {save1.Value}
datastore:GetAsync(plrid, NumberForSaving)
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
datastore:SetAsync("id_"..plr.UserId{plr.leaderstats.Coins.Value})
end)

1 comment
anyone helping me out? its been 11 hours and i need this bad