Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

One DataStore storing two individual numbers?

Sorry if this is a really stupid question, I'm very new to DataStores.

For my game, it asks you questions and gives you two answers to choose from. For each one, I want a number value to equal the number of people that chose that one over the other one. I currently have been testing it with two data stores, but is it possible to do it with one? I'd still need to access each number individually and work with it.

3 comments

0

You could make it a table instead. local tab = {[1] = 50, [2] = 55}

0

I need it to be permanent and able to change live across all servers, so I have to use DataStores.

0

He meant you can save a table to DataStore.

1 answer

As it has been said in the comments, save it to a table:

num1 = 7 -- Any integer
num2 = 123 -- Any integer
ds = game:GetService("DataStoreService"):GetDataStore("Numbers")
ds:SetAsync(game.Players.Player1.userId,{num1,num2})

Next time please answer the question so it doesn't appear in the unanswered question sort.

This discussion is preserved as it was. New answers, comments, and votes are closed.