Slicer, estou com um bug aqui, quando efetuo a talkaction do "writetable"
[25/12/2012 19:17:33] [Error - TalkAction Interface]
[25/12/2012 19:17:33] data/talkactions/scripts/writeTable.lua:onSay
[25/12/2012 19:17:33] Description:
[25/12/2012 19:17:33] data/talkactions/scripts/writeTable.lua:11: attempt to concatenate field 'offense' (a nil value)
[25/12/2012 19:17:34] stack traceback:
[25/12/2012 19:17:34] data/talkactions/scripts/writeTable.lua:11: in function <data/talkactions/scripts/writeTable.lua:1>
da este erro no console...
script:
function onSay(cid, words, param, channel)
local str = "pokes = {"
local file = io.open('data/writeTable.txt', 'w')
if (not file) then
sendMsgToPlayer(cid, 20, "File: data/writeTable.txt, not found...")
return true
end
for i, table in ipairs(oldpokedex) do
local t = pokes[table[1]]
str = str.. '\n\n["'..table[1]..'"] = {offense = '..t.offense..', defense = '..t.defense..', specialattack = '..t.specialattack..', vitality = '..t.vitality..', agility = '..t.agility..', exp = '..t.exp..', level = '..t.level..', wildLvl = '..t.level..', type = "'..t.type..'", type2 = "'..t.type2..'"},'
end
str = str.."\n}"
file:write(str)
file:close()
sendMsgToPlayer(cid, 20, "Table add in file 'data/writeTable.txt'...")
return true
end