Please help me, Lua U bug when making a table dictionary

You can write your topic however you want, but you need to answer these questions:

i want to create a dictionary in Lua U but i don’t know how to

image

i tried to just make it normal

grass = {}
but that didn’t work either

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

I recommend you reading this post about Tables

I don’t really know what you’re trying to achieve, but you could do something like this:

local BlockInfo = {
    Grass = "Grass"
};

I’m trying to use Lua U. Surely dictionaries should be possible to make in Lua U, right?

Yeah, Luau has got arrays & dictionaries, both explained in the page I linked above.

I can’t see any Lua U on that page

Creating a dictionary in Lua is simple.

local blockInformation = {
    grass = "Grass"
}

print(blockInformation.grass) -> "Grass"

Thank you, I fully understand this code. But I want it to be Luau compatible

The code I provided would still work, try it out in Roblox Studio.

Ok thanks, I guess it’s a temporarily solution, but is it possible to have an array of arrays in lua U?

a dictionary of arrays*
ppepepepewpepewe

local blockInformation = {
    grass = {
        "Grass"
    }
}

You can store tables in dictionaries, as well as other dictionaries inside of dictionaries.

Wonderful, thanks! But it’s not Lua u

The code would still work, there’s no special syntax for stuff like this.

Ok thanks a bunch :smile: :smile:

Luau is pretty much the same as Lua except for some edits here and there. Most of what you do in Lua should be compatible with Luau and vice versa.

2 Likes