Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why candy and CompletedData dont saves? CompletedData is a bool value.

Asked by 2 years ago
Edited 2 years ago

Please! Script:


local ds = game:GetService("DataStoreService"):GetDataStore("SaveData") game.Players.PlayerAdded:Connect(function(plr) wait() local plrkey = "id_"..plr.UserId local save1 = plr.leaderstats.Stages local save2 = plr.leaderstats.Points local save3 = plr.leaderstats.Candy local save4 = plr.PlayerGui.QuestGui.CompletedData local GetSaved = ds:GetAsync(plrkey) if GetSaved then save1.Value = GetSaved[1] save2.Value = GetSaved[2] save3.Value = GetSaved[3] save4.Value = GetSaved[4] else local NumberForSaving = {save1.Value, save2.Value, save3.Value, save4.Value} ds:GetAsync(plrkey, NumberForSaving) end end) game.Players.PlayerRemoving:Connect(function(plr) ds:SetAsync("id_"..plr.UserId, {plr.leaderstats.Stages.Value, plr.leaderstats.Points.Value, plr.leaderstats.Candy.Value, plr.PlayerGui.QuestGui.CompletedData.Value}) end)
0
I may use loops, IsA, and other thing but i dont know how SashaPro336 47 — 2y
0
Do you mind fixing the code block? AProgrammR 398 — 2y
0
Yes, how i need to fix? SashaPro336 47 — 2y
0
I mean what i need to do? SashaPro336 47 — 2y

Answer this question