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)

9 comments

0

Maybe you can save the Values folder? XD

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.

0

that is my problem ^

0

eyy, did u get an error, did it fail to load the player?

0

No. I got argument 2 missing or nil

0

Have you tried making a table in the script and saving the folder of values to the table and saving that table?

0

serverstorage??! um you mean datastorage

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!

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.