Content added Content deleted
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
p.getWeapon = function(frame) |
p.getWeapon = function(frame) |
||
local weapon = frame.args[1] |
local weapon = frame.args[1] |
||
for |
for k in pairs(weapons_table) do |
||
if weapons_table[i]['name'] == weapon then |
if weapons_table[i]['name'] == weapon then |
||
local txt = weapons_table[i]['name'] |
local txt = weapons_table[i]['name'] |
||
end |
end |
||
end |
end |
||
return |
return k |
||
end |
end |
||
Revision as of 22:21, 9 December 2021
Documentation for this module may be created at Module:Weapon/doc
local weapons_table = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{title='Template:Weapons.json'})
local p = {}
p.getWeapon = function(frame)
local weapon = frame.args[1]
for k in pairs(weapons_table) do
if weapons_table[i]['name'] == weapon then
local txt = weapons_table[i]['name']
end
end
return k
end
return p