So I've been scripting some Lua and when using tables I wanted to make something similar to a "node" or "class"
local playerInfo = {}
if player then
local newPlayer = {NAME = name, HP = 10, DMG = 4}
table.insert(playerInfo, newPlayer)
end
for k, v in pairs(playerInfo) do
print(v.NAME)
end
This is just an example of what I'm doing, but is it OK to access information like this? Or is there a more efficient way?