• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Actions] Need help with TFS based script.

EvulMastah

๏̯͡๏﴿
Premium User
Joined
Aug 19, 2007
Messages
4,941
Solutions
11
Reaction score
352
Ok, so here's my code:
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
When there is nothing on that tile.

Thanks.
 
Last edited:
Back
Top