• 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!

[Request] Move item without portal

Omen

New Member
Joined
Sep 11, 2008
Messages
70
Reaction score
0
Can someone help me write a script that moves a specific item placed in a spot (not a teleporter) to another spot, and all other items are moved to another location?
 
Hmm, more specify if it should be movement, or onUse action ;>

Try this switch: (It will move all movable items and creatures from 1 place to other)
Code:
local FROM_POS = {x=11, y=22, y=33}
local TO_POS = {x=44, y=55, y=66}
---
local relocated = FALSE

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 1945 and relocated == FALSE then
		doTransformItem(item.uid, 1946)
		doRelocate(FROM_POS, TO_POS)
		relocated = TRUE
	elseif relocated == TRUE
		doPlayerSendCancel(cid, 'Item was already teleported')
	else
		doTransformItem(item.uid, 1945)
	end
end
 
Last edited:
Can someone help me write a script that moves a specific item placed in a spot (not a teleporter) to another spot, and all other items are moved to another location?
I'd like to know the actionid or uniqueid of the tile that items will be placed on. Also, the itemid, actionid, or uniqueid of the item that you want teleported to a specific place. Ontop of that, the position of where you want the specific item to be placed, and the position of where you want the other items to be placed.

Note that I make no promises that I can create this script, but I'm pretty sure I'll need those to start.
 
I dont know if its a mvoement or an action, the idea is people can throw a letter onto a table and the table moves that letter to my box in my house, and any other items thrown in there are trashed

ItemID is 1623, action ID you can set to any ill change it.

the target is
ItemID: [1621].
Position: [X: 1624] [Y: 1651] [Z: 6].

the item i want moved is
ItemID: [2597].

any other items I want moved here
ItemID: [1777].
Position: [X: 1624] [Y: 1650] [Z: 6].
 
Code:
function onAddItem(moveitem, tileitem, position)
    local NEW_POS = { x = 1, y = 1, z = 1 }
    local TRASH_POS = { x = 1, y = 1, z = 1 }
    if tileitem.actionid == ACTIONIDOK? then
        if moveitem.itemid == 2597 then
            doTeleportThing(moveitem.uid, NEW_POS, 0)
        else
            doTeleportThing(moveitem.uid, TRASH_POS, 0)
        end
    doSendMagicEffect(position,CONST_ME_MAGIC_BLUE)
    end
    return TRUE
end

Set the actionid of the table to some number.
Try.

@
Sorry for not giving movements.xml part :p
Code:
<movevent event="AddItem" tileitem="1" actionid="sameastableactionid" script="additem.lua" />
 
Last edited:
Back
Top Bottom