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

How do I make a string that consists of a table, so that i can use it as a table?

for example I have this code

local table = "{Cald_fan = 3, otherperson = 5}"

But i want something that makes it be a table, not a string so it will be like this instead

{Cald_fan = 3, otherperson = 5}

the reason i am asking a question like this is because trello api returns strings, and the information is a table.

5 comments

0

not possible to my knowledge, but why would you even want this

0

as i said, the trello card contains the table, and i need to get the data from the table

0

Try using JSONDecode and JSONEncode?

0

ok

0

You would need quite a bit of string manipulation

1 answer

✓ Accepted answer

This method is an alternative to JsonDecode and is not recommended because of lack in security.

local strtable = "{Cald_fan = 3, otherperson = 5}"
strtable = loadstring("return " .. strtable)() -- Make sure you enable loadstring in serverscriptservice.

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