Content added Content deleted
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
} |
} |
||
for index, data in pairs(people) do |
|||
for key, value in pairs(data) do |
|||
print(value) |
|||
end |
|||
end |
|||
local p = {} |
local p = {} |
||
Revision as of 22:00, 27 November 2021
This module retrieves data from the "Loot tables.json" template according to the {{PAGENAME}} (usually, an NPC name) provided as an argument value.
local people = {
{
name = "Fred",
address = "16 Long Street",
phone = "123456"
},
{
name = "Wilma",
address = "16 Long Street",
phone = "123456"
},
{
name = "Barney",
address = "17 Long Street",
phone = "123457"
}
}
local p = {}
p.getLootTable = function(frame)
for index, data in pairs(people) do
for key, value in pairs(data) do
return value
end
end
end
return p