I have it :
ani_solo.lua :
actions.xml :
And console error :
It don't teleport me - Please Help !
ani_solo.lua :
Code:
local config = {
daily = "no", -- allow only one enter per day? (like in global Tibia)
level = 100,
storage = 11014
}
local playerPosition =
{
{x = 974, y = 894, z = 8}
}
local newPosition =
{
{x = 541, y = 827, z = 7}
}
config.daily = getBooleanFromString(config.daily)
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(item.itemid == 1946) then
if(config.daily) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTransformItem(item.uid, item.itemid - 1)
end
return true
end
if(item.itemid ~= 1945) then
return true
end
local players = {}
for _, pos in ipairs(playerPosition) do
local pid = getTopCreature(pos).uid
if(pid == 0 or not isPlayer(pid) or getPlayerStorageValue(pid, config.storage) > 0 or getPlayerLevel(pid) < config.level) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
return true
end
players[i] = pid
end
for i, pid in ipairs(players) do
doSendMagicEffect(playerPosition[i], 10)
doTeleportThing(pid, newPosition[i], false)
doSendMagicEffect(newPosition[i], 10)
end
doTransformItem(item.uid, item.itemid + 1)
return true
end
actions.xml :
Code:
-Ani-Solo
<action uniqueid="11014" event="script" value="moje/ani_solo.lua"/>
![vfj2f.jpg](/proxy.php?image=http%3A%2F%2Fscreenshotuploader.com%2Fi%2F1310%2Fvfj2f.jpg&hash=c5b39767dcd8714c1fd35378b09b1a42)
And console error :
Code:
[Error - Action Interface]
[15/10/2013 19:15:26] data/actions/scripts/moje/ani_solo.lua:onUse
[15/10/2013 19:15:26] Description:
[15/10/2013 19:15:26] data/actions/scripts/moje/ani_solo.lua:41: table index is nil
[15/10/2013 19:15:26] stack traceback:
[15/10/2013 19:15:26] data/actions/scripts/moje/ani_solo.lua:41: in function <data/actions/scripts/moje/ani_solo.lua:18>
It don't teleport me - Please Help !