Sandessat
(Sandy)
November 29, 2020, 7:58am
#1
Hello! I’m starting to learn LuaU, but I’m trying to make a table that has different value names for them, but the LuaU rules are not letting me do it. Example:
local MyTable:table = {
[1] = "Hey!"
[2] = "Lol!"
}
It says that Unknown Type 'table'
, but I don’t know why is this happening.
Can someone help me?
sjr04
(uep)
November 29, 2020, 7:59am
#2
There is no generic table type yet, but you can do
type array = { any }
local my_table: array = { "Hey!", "Lol!" }
to get a generic array type.
Also, it’s Luau, lowercase “u”
7 Likes
Sandessat
(Sandy)
November 29, 2020, 8:00am
#3
Oh! Thank you so much for telling me, I didn’t know that any
was a thing, and sorry for putting the u
in Luau!
1 Like
DevSended
(BINGUS)
November 20, 2024, 6:42pm
#4
This was very helpful, thank you!