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

need help with this script

kymurax

New Member
Joined
Dec 29, 2009
Messages
53
Reaction score
0
guys please I need the following script, When using a certain item on another item, the item that is used disappears and gives me a new item, example, if I use an item on a tomb this disappears and gives me another item in exchange, I would greatly appreciate them! Thanks in advance
 
Code:
<action itemid="1111111" event="script" value="script.lua" />
Code:
local tomb_id = 22222
local new_item = 3333333

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if itemEx.itemid = tomb_id then
       doTransformItem(item.uid, new_item)
   end
   return true
end

if stackable..
Code:
local tomb_id = 11111
local new_item = 22222

function onUse(cid, item, fromPosition, itemEx, toPosition)
   if itemEx.itemid = tomb_id then
       doRemoveItem(item.uid, 1)
       doPlayerAddItem(cid, new_item, 1, true)
   end
   return true
end

and ff, can't edit my above post. wtf. lmao
 
Last edited by a moderator:
A question to know if I understood correctly, this <action itemid = "11111" script = "bookquest.lua" /> is the item that I will use on the object that will give me the new object? Local tomb_id = 11111 this is the tomb, local new_item = 22222 and this is the new object that will give me when using the object of my bp on the tomb? sorry for the inconvenience
 
I hope it serves you friend.

Lua:
local config = {
    useItemToTomb = 0000,
    tombId = 0000,
    newItem = { id = 0000, count = 0000 },
    message = 'You are resive item...'
}

function onUse(player, item, fromPos, itemEx, toPos)
local tomb = itemEx
local useItem = item
if (useItem.itemid == config.useItemToTomb) and (tomb.itemid == config.tombId) then
doRemoveItem(useItem, 1)
doPlayerAddItem(player, config.newItem.id, config.newItem.count)
doPlayerSendTextMessage(player, 22, config.message)
end
return true
end
 
Back
Top