What I am doing is,
If an itemid = 6289 is in this position then remove the item and create another item on the same position. I got this script but it seems to not working and I don't get any errors in console:
If an itemid = 6289 is in this position then remove the item and create another item on the same position. I got this script but it seems to not working and I don't get any errors in console:
Lua:
local fire = 6289
local energy = 5069
local earth = 6238
local ice = 6746
local paoss = {x=911, z=1178, y=7}
local fireitempos = getTileItemById(paoss, fire)
local energyitempos = getTileItemById(paoss, energy)
local earthitempos = getTileItemById(paoss, earth)
local iceitempos = getTileItemById(paoss, ice)
function onThink(interval, lastExecution, thinkInterval)
if getTileItemById(paoss, fire) == true then
doRemoveItem(fireitempos.uid)
doCreateItem(energy, 1, paoss)
elseif getTileItemById(paoss, energy) == true then
doRemoveItem(energyitempos.uid, 1)
doCreateItem(earth, 1, paoss)
elseif getTileItemById(paoss, earth) == true then
doRemoveItem(earthitempos.uid)
doCreateItem(ice, 1, paoss)
elseif getTileItemById(paoss, ice) == true then
doRemoveItem(iceitempos.uid)
doCreateItem(fire, 1, paoss)
end
return true
end
XML:
<globalevent name="AaTeleport" interval="5000" event="script" value="attel.lua"/>