Is it possible to make something like
local baba = {
["lol"] = "ok"
}
print(baba[1])
wait(1)
print(baba[1][1])
Which will make the first print function print “lol”, and the 2nd one "ok"
I’m trying everything and it’s not working at all
Is it possible to make something like
local baba = {
["lol"] = "ok"
}
print(baba[1])
wait(1)
print(baba[1][1])
Which will make the first print function print “lol”, and the 2nd one "ok"
I’m trying everything and it’s not working at all
Yes.
function indexthing(str: string, t: {})
for i,v in t do -- iterates through table
if i ~= str then continue end -- if index not found
print(i,v) -- prints both index and value
end
end
indexthing("lol", baba) --> lol ok
You would have to Reference it as a Dictionary key, not as an Array, so like:
baba.lol
-- or:
baba["lol"]
So it won’t work on arrays. Alright. But the arrays will work on the table inside, for the same reason. I checked that already. (Unless the table inside it has another table too)
Last question: Will table.find() work on it?
Only for Arrays, not Dictionaries
So for table.find this time I’ll have to use arrays?