- Joined
- Aug 19, 2007
- Messages
- 4,941
- Solutions
- 11
- Reaction score
- 352
Ok, so here's my code:
As You can see, this is a bridge and when the walkable tile is transforming into water, the creature & player are moved 1 sqm to the north (that is working good), but, when there is an item on that tile, its not being destroyed, its just still lieing there, on the water tile.
I want someone to fix that for me, when there will be an item on the transforming into water tile, I want it to be removed and the magic effect must be sent.
Also, I wanted to ask if that is somehow possible for server window to now show that:
When there is nothing on that tile.
Thanks.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local bridgepos = {x = 772, y = 683, z = 8, stackpos = 253}
local bridgeThing = getThingfromPos(bridgepos)
local newpos = {x = 772, y = 682, z = 8}
if item.itemid == 1945 then
doTransformItem(item.uid, item.itemid + 1)
doSendMagicEffect(bridgepos, CONST_ME_POFF)
doCreateItem(1284, 1, bridgepos)
else
doTransformItem(item.uid, item.itemid - 1)
doSendMagicEffect(bridgepos, CONST_ME_POFF)
doCreateItem(493, 1, bridgepos)
if isPlayer(bridgepos) then
doTeleportThing(bridgeThing.uid, newpos, TRUE)
elseif isCreature(bridgepos) then
doTeleportThing(bridgeThing.uid, newpos, TRUE)
elseif isItem(bridgepos) then
doRemoveItem(bridgeThing)
doSendMagicEffect(bridgepos, CONST_ME_LOSEENERGY)
return TRUE
end
end
end
As You can see, this is a bridge and when the walkable tile is transforming into water, the creature & player are moved 1 sqm to the north (that is working good), but, when there is an item on that tile, its not being destroyed, its just still lieing there, on the water tile.
I want someone to fix that for me, when there will be an item on the transforming into water tile, I want it to be removed and the magic effect must be sent.
Also, I wanted to ask if that is somehow possible for server window to now show that:
Code:
luaDoTeleportThing(). Thing not found
Thanks.
Last edited: