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

Can a table be stored in an IntValue Instance?

So I want to know if you can do this, lt will help me a lot. Will something like this work?

local list = {"A", "B", "C", "..."}

local value = Instance.new("IntValue")
value.Value = list
print(value.Value[1])

2 answers

✓ Accepted answer

No. As the name suggests, it only accepts an int value. One way you could make a table and store it in the explorer could be creating a folder with the name of the table, looping through the table, and creating the appropriate value to the type of the table member. You can find the type of a variable using type(foo) for built-ins (string, int, bool, etc.) and typeof(bar) for those exclusive to rbx.lua

An IntValue explicitly takes a number in it's value, you can't put a table in it like that. Int stands for Integer which basically means a number without decimals.

2 comments

0

Exactly. You could use a folder with int values in it however it can be easily manipulated client-side. There must be other ways to achieve what you're looking for, i'd just stick to tables and not actual instances to store values.

0

You can put the length of the table or a single value from the table or a concatenation of all values inside the table (Int's)

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