--the example they have local module = {} module.VehicleData = { -- Rocket Sled RocketSled = { displayName = "Rocket Sled", topSpeed = 120 }, -- Spider Tank SpiderTank = { displayName = "Spider Tank", topSpeed = 40 }, } return module
I saw the above code in the link, I am confused about the module.VehicleData
part.
Is that like the game tree in that they can have different parts to them?
You can have it like RandomPart.Stats
That code is in a module script. I've had trouble with a module script before and a player gave a great explanation of what it does because I didn't understand what a module script is. Click here to see my problem and the answer describing module scripts. Hopefully, something in the answer answers your question in more detail, but here I go trying to explain it in what I think it is.
A module script is basically a table. What this is, is a table inside of a table. The table in this example is stats, as in you can use this table to get stats about, in this case, the Rocket Sled or Spider Tank vehicle. If you require the module and look at VehicleData and inside of VehicleData you could choose between what stat table you want. Once you found the stat table you want you can look in there to find the different stats. This means you can use a module script to hold stats for items in a category of items such as a vehicle, weapon, furniture, etc.