Hello.
I convert tfs 0.4 my scripts to 1.2. I do not know what could be wrong.
Console:
Script:
I convert tfs 0.4 my scripts to 1.2. I do not know what could be wrong.
Console:
Code:
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/pomniki/pomnik_z_najlepszym_graczem.lua:onThink
...alevents/scripts/pomniki/pomnik_z_najlepszym_graczem.lua:13: attempt to call global 'getThingFromPos' (a nil value)
stack traceback:
[C]: in function 'getThingFromPos'
...alevents/scripts/pomniki/pomnik_z_najlepszym_graczem.lua:13: in function <...alevents/scripts/pomniki/pomnik_z_najlepszym_graczem.lua:10>
[Error - GlobalEvents::think] Failed to execute event: hof
Script:
Code:
local tbl = {
[1] = {pos= {x = 1036, y = 1025, z = 7, stackpos = 1}, prof = 'all', text2 = 'player'}, -- lvl
-- [2] = {pos= {x = 1030, y = 1027, z = 7, stackpos = 1}, prof = '1, 5', text2 = 'sorcerer'}, -- sorcerer, ms
-- [3] = {pos= {x = 1032, y = 1027, z = 7, stackpos = 1}, prof = '2, 6', text2 = 'druid'}, -- druid, ed
-- [4] = {pos= {x = 1034, y = 1027, z = 7, stackpos = 1}, prof = '3, 7', text2 = 'paladin'}, -- palladin, rp
-- [5] = {pos= {x = 1036, y = 1027, z = 7, stackpos = 1}, prof = '4, 8', text2 = 'knight'}, -- knight, ek
--[index] = {pos = {pozycja, pamietaj o stackpos!}, prof = 'id profesji', text2 = 'string z nazwa profesji'},
}
function onThink(interval)
local best, profe, kam = '', 0, 0
for index, options in ipairs(tbl) do
local kam = getThingFromPos(options.pos).uid
if(options.prof == 'all') then
best = db.getResult("SELECT `level`,`name` FROM `players` WHERE `group_id` < '2' AND `account_id` > '1' ORDER BY `experience` DESC LIMIT 1;")
if(best:getID() ~= -1) then
doItemSetAttribute(kam, 'description', 'Najwiekszy poziom na serwerze ma gracz '..best:getDataString('name')..'. Posiada '..best:getDataInt('level')..' level.')
else
doItemSetAttribute(kam, 'description', 'Aktualnie brak informacji')
end
doSendMagicEffect(options.pos, 66)
else
profe = string.explode(options.prof, ',')
best = db.getResult("SELECT `level`,`name` FROM `players` WHERE (`vocation` = '"..tonumber(profe[1]).."' OR `vocation` = '"..tonumber(profe[2]).."') AND `group_id` < '2' AND `account_id` > '1' ORDER BY `experience` DESC LIMIT 1;")
if(best:getID() ~= -1) then
doItemSetAttribute(kam, 'description', 'Currently, the best '..options.text2..' is '..best:getDataString('name')..' ('..best:getDataInt('level')..' level)')
else
doItemSetAttribute(kam, 'description', 'Currently, on a server doesn\'t play none '..options.text2)
end
doSendMagicEffect(options.pos, 66)
end
end
return true
end