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

How to save multiple boolvalues at once?

Asked by 6 years ago

Hi. So i'm trying to make a game where it saves boolvalues for all the things you have collected. The values are stored inside the player in the folder. And i don't know what to do after. Please help.

local DSS = game:GetService("DataStoreService")
local BG = DSS:GetDataStore("Bloxies")
local player = game.Players.LocalPlayer
local key = "id-"..player.UserId
script.Parent.MouseButton1Click:Connect(function()
    local values = player.Values:GetChildren()
    BG:SetAsync(key,values.Value)
end)


game.Players.PlayerAdded:Connect(function()
    local values = player.Values:GetChildren()
    values.Value = BG:SetAsync(key)
end)

0
Maybe you can save the Values folder? XD Lolamtic 63 — 6y
0
That might be possible. But roblox has limits. I don't want to stress the CPU of anyone's computer out. So there won't be like 100000000 value folders in serverstorage. slay_unknown -3 — 6y
0
that is my problem ^ greatneil80 2647 — 6y
0
eyy, did u get an error, did it fail to load the player? greatneil80 2647 — 6y
View all comments (5 more)
0
No. I got argument 2 missing or nil slay_unknown -3 — 6y
0
Have you tried making a table in the script and saving the folder of values to the table and saving that table? Troidit 253 — 6y
0
serverstorage??! um you mean datastorage Lolamtic 63 — 6y
0
1)Instances cannot be saved with DataStore, however, you can do this with DataPresistance which is not recommended. 2)In school, you probably heard of an array. Well, guess what! It's in programming too! hiimgoodpack 2009 — 6y
0
Also, items in serverstorage DO NOT get replicated to anyone's computer. So, you should store maps, intvalues, anything that you want to save for later/anything that you want to keep safe from hackers. Your only stressing out ROBLOX. Your putting stress already using their web something they use to save information. hiimgoodpack 2009 — 6y

Answer this question