Hey, I have problem with this script:
Whats the problem?
When someone stepin on item with UID 23420 (and special item[2342] is created) then item ID 416 should transform to 417:
so I tried modify this script to:
But it doesn't work. Whats wrong?
Lua:
<movevent type="StepIn" uniqueid="23420" event="script" value="final.lua"/>
Lua:
local pos = {x=33198, y=32876, z=11}
function onStepIn(cid, item, position)
if isPlayer(cid) == TRUE then
for i = 2335, 2341 do
if getTileItemById(pos, i).uid < 1 then return end
end
for i = 2335, 2341 do
doRemoveItem(getTileItemById(pos, i).uid)
end
doCreateItem(2342, 1, pos)
doSendMagicEffect(pos, CONST_ME_FIREAREA)
setPlayerStorageValue(cid,65498,1)
end
end
Whats the problem?
When someone stepin on item with UID 23420 (and special item[2342] is created) then item ID 416 should transform to 417:
so I tried modify this script to:
Lua:
<movevent type="StepIn" uniqueid="23420" event="script" value="final.lua"/>
<movevent type="StepOut" uniqueid="32149" event="script" value="final.lua"/>
Lua:
local pos = {x=33198, y=32876, z=11}
local poss = {x=33198, y=32877, z=11}
function onStepIn(cid, item, position)
if isPlayer(cid) == TRUE then
for i = 2335, 2341 do
if getTileItemById(pos, i).uid < 1 then return end
end
for i = 2335, 2341 do
doRemoveItem(getTileItemById(pos, i).uid)
end
doItemSetAttribute(doCreateItem(417, 1, poss), "uid", 32149)
doRemoveItem(23420,1)
doCreateItem(2342, 1, pos)
doSendMagicEffect(pos, CONST_ME_FIREAREA)
setPlayerStorageValue(cid,65498,1)
end
end
function onStepOut(cid, item, pos)
local stone_pos = {x=33198, y=32877, z=11}
if item.uid == 32149 and isPlayer(cid) == TRUE then
doItemSetAttribute(doCreateItem(416, 1,stone_pos), "uid", 23420)
end
return true
end
But it doesn't work. Whats wrong?