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

How to datastore a large amount of items for a shop?

Asked by 5 years ago

So I have a shop, which will probably have like 20 items when Im done. I want the things players buy to save, but if I use my traditional saving system, the datastore will get full and stop working. Any help on this? Here is my saving system:

local datastore = game:GetService("DataStoreService")
local ds1 = datastore:GetDataStore("JumpPowerSaveSystem")--change all "JumpPower" to what value you want and keep doing it 
local ds2 = datastore:GetDataStore("RebirthsSaveSystem")--change all "Rebirths" to what value you want  and keep doing it
local ds3 = datastore:GetDataStore("GemsSaveSystem")--change all "Rebirths" to what value you want  and keep doing it

game.Players.PlayerAdded:connect(function(plr)
 local folder = Instance.new("Folder", plr)
 folder.Name = "leaderstats"
 local JumpPower = Instance.new("IntValue", folder)
 JumpPower.Name = "JumpPower"
 local Rebirths = Instance.new("IntValue", folder)
 Rebirths.Name = "Rebirths"
  local Gems = Instance.new("IntValue", folder)
 Gems.Name = "Gems"


 JumpPower.Value = ds1:GetAsync(plr.UserId) or 0
 ds1:SetAsync(plr.UserId, JumpPower.Value)

 Rebirths.Value = ds2:GetAsync(plr.UserId) or 0
 ds2:SetAsync(plr.UserId, Rebirths.Value)

 Gems.Value = ds3:GetAsync(plr.UserId) or 0
 ds3:SetAsync(plr.UserId, Gems.Value)



end)

game.Players.PlayerRemoving:Connect(function(plr)
    local leaderstats = plr:FindFirstChild("leaderstats") 
    local jumppower = leaderstats:FindFirstChild("JumpPower") 
    local rebirths = leaderstats:FindFirstChild("Rebirths") 
    local gems = leaderstats:FindFirstChild("Gems") 
      ds1:SetAsync(plr.UserId, jumppower.Value)
      ds2:SetAsync(plr.UserId,rebirths.Value)
     ds3:SetAsync(plr.UserId, gems.Value)
end)

0
Make a table. DinozCreates 1070 — 5y
0
Can you please demonstrate? CaptainD_veloper 290 — 5y
0
It is highly unlikely your datastore will go full with just 20 items. The max size for a datastore is around 260000 characters. Rheines 661 — 5y

Answer this question