Hey there!
I’m trying to make a script like ONLY data variable numbers print out.
Here is the table:
{"data":[1,2,3,4],"total":4}
How can I make it like it only prints out 1, 2, 3, 4?
I’ve tried a lot way but it says nil.
Hey there!
I’m trying to make a script like ONLY data variable numbers print out.
Here is the table:
{"data":[1,2,3,4],"total":4}
How can I make it like it only prints out 1, 2, 3, 4?
I’ve tried a lot way but it says nil.
The Lua(u) equivalent of this JSON data is:
{
data = { 1, 2, 3, 4 },
total = 4
}
This is a dictionary. You will need to use pairs
to iterate over its contents.
To target just the one item,
print(dictionary.data) --> { 1, 2, 3, 4 }
for k, v in pairs(TABLE) do
if typeof(v) == "number" then
print(("%s is a number!"):format(tostring(v)))
end
end
Alright! Thank you for y’all replies! I try and I mark the correct answer as a solution.