Well, I have a little problem working with my script...
All it do is transform a wall into a door and after some seconds (in script i put 3) it transform back to a wall..
The script works correctly, BUT when i put some trash into the opened door, it transform back into the wall, but the trash remains stacked over the wall...
How can I clean the tile and only after that, transform back to the wall?
Sorry for my very bad english... Hope you guys understand what i'm saying!
Here's the script i did:
All it do is transform a wall into a door and after some seconds (in script i put 3) it transform back to a wall..
The script works correctly, BUT when i put some trash into the opened door, it transform back into the wall, but the trash remains stacked over the wall...
How can I clean the tile and only after that, transform back to the wall?
Sorry for my very bad english... Hope you guys understand what i'm saying!
Here's the script i did:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)
local katanaDoor = Tile(32177, 32148, 11)
local transfPos = Position(32177, 32148, 11)
if item.itemid == 3670 then
katanaDoor:getPosition():sendMagicEffect(CONST_ME_POFF)
katanaDoor:getItemById(1025):transform(1210)
Item(item.uid):transform(3668)
addEvent(function(pillarPos)
local test = katanaDoor:getItemById(1210)
local test2 = katanaDoor:getItemById(1211)
if test then
test:remove()
Game.createItem(1025, 1, pillarPos)
else
test2:remove()
Game.createItem(1025, 1, pillarPos)
end
pillarPos:sendMagicEffect(CONST_ME_POFF)
Item(item.uid):transform(3670)
end, 3000, katanaDoor:getPosition())
elseif item.itemid == 3668 then
return false
end
return true
end