Alright so i asked this question already about a month ago i did get an answer but it didnt seem to fix the problem so here it is. So basicly its a Datastore script thats meant to save the player`s cash and the vehicles that the player has purchased but it only saves the cash value but it dosent save the cars purchased, could someone help?
Script:
local DataStore = game:GetService("DataStoreService")
local ds1 = DataStore:GetDataStore("im not showing this")
local success, err = pcall(function()
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder", player)
leader.Name = "leaderstats"
local Cash = Instance.new("IntValue", leader)
Cash.Name = "Cash"
Cash.Value = ds1:GetAsync(player.UserId) or 0
ds1:SetAsync(player.UserId, Cash.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Zilko_Natalia.Purchased.Value, player.UserId.."Purchased_Zilko_Natalia")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_D.Purchased.Value, player.UserId.."Purchased_Voyage_D")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Ferra.Purchased.Value, player.UserId.."Purchased_DA_Ferra")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Venerra.Purchased.Value, player.UserId.."Purchased_DA_Venerra")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Hektor_Mediona.Purchased.Value, player.UserId.."Purchased_Hektor_Mediona")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Mounts_Rake.Purchased.Value, player.UserId.."Purchased_Mounts_Rake")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Novena_Acesera.Purchased.Value, player.UserId.."Purchased_Novena_Acesera")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Roland_Motors_GTR.Purchased.Value, player.UserId.."Purchased_Roland_Motors_GTR")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Surge_Maple_R.Purchased.Value, player.UserId.."Purchased_Surge_Maple_R")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_Jalanster_Betamobili.Purchased.Value, player.UserId.."Purchased_Voyage_Jalanster_Betamobili")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_Pengangkuter_30_CWT.Purchased.Value, player.UserId.."Purchased_Voyage_Pengangkuter_30_CWT")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Ferra_F8_RT_Edition.Purchased.Value, player.UserId.."Purchased_DA_Ferra_F8_RT_Edition")
wait(5)
--Cash.Changed:connect(function()
print("SavingData")
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Zilko_Natalia.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_D.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Ferra.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Venerra.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Hektor_Mediona.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Mounts_Rake.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Novena_Acesera.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Roland_Motors_GTR.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Surge_Maple_R.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_Jalanster_Betamobili.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_Pengangkuter_30_CWT.Purchased.Value)
ds1:SetAsync(player.UserId, Cash.Value)
end)
--end)
game.Players.PlayerRemoving:connect(function(player)
local SavedData = Instance.new("BindableEvent")
ds1:setAsync(player.UserId, player.leaderstats.Cash.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Zilko_Natalia.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_D.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Ferra.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.DA_Venerra.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Hektor_Mediona.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Mounts_Rake.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Novena_Acesera.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Roland_Motors_GTR.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Surge_Maple_R.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_Jalanster_Betamobili.Purchased.Value)
ds1:SetAsync(game.StarterGui.PurchaseGUI.Frame.Voyage_Pengangkuter_30_CWT.Purchased.Value)
SavedData:Fire()
game:BindToClose(function()
SavedData.Event:Wait()
end)
end)
end)

7 comments
change game.StarterGui.PurchaseGui to player.PlayerGui.PurchaseGui
i replaced all but it didnt work.
You would want to create a folder instead of a value. Insert The Cars Purchased Into The Folder Then Save The Folder For The Player. Easier Said Than Done, but it can be done
Is that the only way to do it? Because that will take hours to replace every line in all of the scripts which has the Value in it.
It is Not The Only Was To Save them, but it is the best way in my opinion. If You want me to post a comment and be more in depth with it than tell me
yes i would like to see you go more in depth with this.
ok i did