Value that saves multiple numbers

Does anyone know what the value is that saves multiple numbers? I want this for the upgrade level and price.

Something like this:

Value: 4, 30

print(Value[1], Value[2])
This print will print the level and price.

1 Like

You can use a table to store values and index them later like such:

local valueTable = {4, 30}
print("First value", valueTable[1])
print("Second value", valueTable[2])

I need a value to use datastore on it

I dont have my Roblox Studio opened right now to test, but I guess you can understand how this would work in case it doesn’t.

local value = Instance.new("StringValue")

value.Value = "4, 30"

local valuesTable = string.split(value, ", ")

print(valuesTable[1], valuesTable[2])
-- just use the tonumber() function if you want to get them as a number

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.