Lua Periodic Table of the Elements

A while back I rewrote a JSON periodic table into Lua for a game, and I want to post it in case anybody else needs it. I realize multiple people have probably posted something like this, but I didn’t find a table more in depth than this one while searching. It contains details like category, period, phase, and other properties.

As an example, this is the description for Hydrogen:

[1] = {
   ["appearance"] = "colorless gas",
   ["atomic_mass"] = 1.008,
   ["block"] = "s",
   ["bohr_model_3d"] = "https://storage.googleapis.com/search-ar-edu/periodic-table/element_001_hydrogen/element_001_hydrogen.glb",
   ["bohr_model_image"] = "https://storage.googleapis.com/search-ar-edu/periodic-table/element_001_hydrogen/element_001_hydrogen_srp_th.png",
   ["boil"] = 20.271,
   ["category"] = "diatomic nonmetal",
   ["cpk-hex"] = "ffffff",
   ["density"] = 0.08988,
   ["discovered_by"] = "Henry Cavendish",
   ["electron_affinity"] = 72.76900000000001,
   ["electron_configuration"] = "1s1",
   ["electron_configuration_semantic"] = "1s1",
   ["electronegativity_pauling"] = 2.2,
   ["group"] = 1,
   ["image"] = {
      ["attribution"] = "User:Jurii, CC BY 3.0 <https://creativecommons.org/licenses/by/3.0>, via Wikimedia Commons, source: https://images-of-elements.com/hydrogen.php",
      ["title"] = "Vial of glowing ultrapure hydrogen, H2. Original size in cm: 1 x 5",
      ["url"] = "https://upload.wikimedia.org/wikipedia/commons/d/d9/Hydrogenglow.jpg"
   },
   ["ionization_energies"] = {
      [1] = 1312
   },
   ["melt"] = 13.99,
   ["molar_heat"] = 28.836,
   ["name"] = "Hydrogen",
   ["named_by"] = "Antoine Lavoisier",
   ["number"] = 1,
   ["period"] = 1,
   ["phase"] = "Gas",
   ["shells"] = {
      [1] = 1
   },
   ["source"] = "https://en.wikipedia.org/wiki/Hydrogen",
   ["spectral_img"] = "https://en.wikipedia.org/wiki/File:Hydrogen_Spectra.jpg",
   ["summary"] = "Hydrogen is a chemical element with chemical symbol H and atomic number 1. With an atomic weight of 1.00794 u, hydrogen is the lightest element on the periodic table. Its monatomic form (H) is the most abundant chemical substance in the Universe, constituting roughly 75% of all baryonic mass.",
   ["symbol"] = "H",
   ["wxpos"] = 1,
   ["wypos"] = 1,
   ["xpos"] = 1,
   ["ypos"] = 1
}

I’m not sure if much of the information will be useful, but you never know. The table contains 119 elements, including the hypothetical element Ununennium.

The module itself can be heavy on your system*, so I suggest requiring it instead of inserting it. The table is called PeriodicTable in the module.

Have fun!

Converted Lua: https://create.roblox.com/store/asset/16230738397/Periodic-Table-of-the-Elements
Original JSON: GitHub - Bowserinator/Periodic-Table-JSON: A json of the entire periodic table.


* On low end devices like mine, studio completely broke after opening the module.

2 Likes

Feedback is appreciated as I’m relatively new to posting on this platform, and I apologize for any mistakes made.

Cool! This could be used as a game idea where people can make combinations of elements!

This is actually pretty cool, i once made very similar thing but for C#