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

[7.6]Transforming 2 items into one

Legalcjooo

New Member
Joined
Jan 14, 2019
Messages
15
Reaction score
1
Hello, I'm looking for a script that will take 2 items from the inventory and give one. Items must be two with itemid 2311 and 2299, if the user does not have at least one item, a failure message will be displayed

I tried to make such a simple script, but I do not know why It do not want to work in the right way (sending messages about incorrect items in equipment when i have items with itemid 2311 and 2399). Engine- 7.6(armia6.6.6)

Code:
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2299 and item2.itemid == 2314 then
doPlayerRemoveItem(cid, 2299,1)
doPlayerRemoveItem(cid, 2314,1)
doPlayerAddItem(cid, 2284,1)
doPlayerSendTextMessage(cid,22,"Runes connected!")
else
doPlayerSendTextMessage(cid,22,"You must have correct runes in the inventory!")
end
return 1
end
 
Solution
The code you have is when you use am item on another item.


function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2299 and item2.itemid == 2314 then

This code is run when you use item on item2 and not a lever.
When I use item 2299 on item 2314, I get item 2284 using the above code.
When I use item 2299 on any other item I get the error message.


You mention 2311 and 2399 are you using the incorrect item ids?
 
I got correct ids, so maybe i try to change engine, do you think it's something wrong with engine?

EDIT: On yurOTS_0.94d same problem.
(2299 in eq-->You must have correct runes in the inventory!
2314 in eq -->You must have correct runes in the inventory!
2299 and 2314 in eq-->You must have correct runes in the inventory!)
 
Last edited:
do you use item1 on item2 or just have them in bp? Please explain exactly how you are testing this.

Good behavior would be also checking if item and item2 exist before you get their ids.
 
When i have runes in bp I'm using the lever. I also tried with runes in hands, with fully clean equipment(without bp, armor etc, only with runes in hands).
 
Last edited:
The code you have is when you use am item on another item.


function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2299 and item2.itemid == 2314 then

This code is run when you use item on item2 and not a lever.
 
Solution
Back
Top