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

Lua Merge items with lever (Action)

snuckles

New Member
Joined
Apr 4, 2009
Messages
39
Reaction score
2
Location
Hong Kong
Need help to transform in TFS 1.X more. I give you REP++

Please someone help me because I have been trying many ways and I can not understand what the problem is, there is no error in the console.

Here is the code LUA, action.

Lua:
function onUse(cid, item, frompos, item2, topos)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)


if item.itemid == 1945 and item1.itemid == 2493 and item2.itemid == 2493 or item1.itemid == 2493 and item2.itemid == 2493 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doTransformItem(item.uid,1946)
doCreateItem(8820,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 2494 and item2.itemid == 2494 or item1.itemid == 2494 and item2.itemid == 2494 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(8819,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 2495 and item2.itemid == 2495 or item1.itemid == 2495 and item2.itemid == 2495 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(8876,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 2400 and item2.itemid == 2400 or item1.itemid == 2400 and item2.itemid == 2400 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(8930,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 9814 and item2.itemid == 9814 or item1.itemid == 9814 and item2.itemid == 9814 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(9815,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 9815 and item2.itemid == 9815 or item1.itemid == 9815 and item2.itemid == 9815 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(9816,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 8930 and item2.itemid == 8930 or item1.itemid == 8930 and item2.itemid == 8930 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(6528,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 6528 and item2.itemid == 6528 or item1.itemid == 6528 and item2.itemid == 6528 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(11307,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 12646 and item2.itemid == 12646 or item1.itemid == 12646 and item2.itemid == 12646 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(11339,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 2646 and item2.itemid == 2646 or item1.itemid == 2646 and item2.itemid == 2646 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(9695,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 8929 and item2.itemid == 2424 or item1.itemid == 2424 and item2.itemid == 8929 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(8928,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 11339 and item2.itemid == 11339 or item1.itemid == 11339 and item2.itemid == 11339 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(9696,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7910 and item2.itemid == 7910 or item1.itemid == 7910 and item2.itemid == 7910 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(13304,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 8848 and item2.itemid == 8848 or item1.itemid == 8848 and item2.itemid == 8848 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(9115,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 10107 and item2.itemid == 10107 or item1.itemid == 10107 and item2.itemid == 10107 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(10108,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7727 and item2.itemid == 7727 or item1.itemid == 7727 and item2.itemid == 7727 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(10103,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 10103 and item2.itemid == 10103 or item1.itemid == 10103 and item2.itemid == 10103 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(15576,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 2368 and item2.itemid == 11773 or item1.itemid == 11773 and item2.itemid == 2368 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(11774,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 6433 and item2.itemid == 6433 or item1.itemid == 6433 and item2.itemid == 6433 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(11344,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 9115 and item2.itemid == 9115 or item1.itemid == 9115 and item2.itemid == 9115 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(14345,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7497 and item2.itemid == 7497 or item1.itemid == 7497 and item2.itemid == 7497 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(7939,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 2136 and item2.itemid == 2136 or item1.itemid == 2136 and item2.itemid == 2136 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(10071,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 10071 and item2.itemid == 10071 or item1.itemid == 10071 and item2.itemid == 10071 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(14333,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 8209 and item2.itemid == 8209 or item1.itemid == 8209 and item2.itemid == 8209 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(7385,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 13304 and item2.itemid == 13304 or item1.itemid == 13304 and item2.itemid == 13304 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(19948,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7702 and item2.itemid == 7702 or item1.itemid == 7702 and item2.itemid == 7702 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(7720,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7720 and item2.itemid == 7720 or item1.itemid == 7720 and item2.itemid == 7720 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(7844,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7844 and item2.itemid == 7844 or item1.itemid == 7844 and item2.itemid == 7844 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(7845,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7845 and item2.itemid == 7845 or item1.itemid == 7845 and item2.itemid == 7845 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(7846,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7846 and item2.itemid == 7846 or item1.itemid == 7846 and item2.itemid == 7846 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(21448,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 7733 and item2.itemid == 7733 or item1.itemid == 7733 and item2.itemid == 7733 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(10148,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

item1pos = {x=965, y=1030, z=7, stackpos=255} --item1pos
item2pos = {x=967, y=1030, z=7, stackpos=255} --item2pos
item3pos = {x=966, y=1030, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)

elseif item.itemid == 1945 and item1.itemid == 22423 and item2.itemid == 22423 or item1.itemid == 22423 and item2.itemid == 22423 then
doRemoveItem(item1.uid,1)
doSendMagicEffect(item1pos,13)
doRemoveItem(item2.uid,1)
doSendMagicEffect(item2pos,13)
doCreateItem(22424,1, item3pos)
doSendMagicEffect(item3pos,6)
doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)

elseif item.uid == 9010 and item.itemid == 1946 then
doTransformItem(item.uid,1945)
else
return 0
end

return 1

end
 
Solution
View attachment bandicam 2021-11-15 20-41-54-825.mp4


XML:
<action actionid="45015" script="fusionLever.lua" />
Lua:
local config = {
    {item_1 = 2493, item_2 = 2493, item_3 = 8820, effect_1 = 13, effect_2 = 13, effect_3 = 6}
}

local positions = {
    position_1 = Position(246, 242, 7), -- item 1 goes here
    position_2 = Position(248, 242, 7), -- item 2 goes here
    position_3 = Position(247, 242, 7) -- resulting item is created here
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getId() == 1946 then
        item:transform(1945)
        return true
    end

    local tile_1 = Tile(positions.position_1)
    local tile_2 = Tile(positions.position_2)
 
    local item_1 = tile_1:getTopDownItem()
    local item_2 =...

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,810
Solutions
433
Reaction score
3,949
The truth has been so long since I saw someone who could solve this kind of thing, I am impressed, you did something impossible, because many people could not solve it, but you yes and I am too happy and grateful, for what you need I am here! thank you you are one great person and finally now I have one last doubt your script works 100% without errors, but I want to know how the hell will I do to add more objects because I need to add a long list.
just keep adding more lines into the config

Lua:
local config = {
    {item_1 = 2493, item_2 = 2493, item_3 = 8820, effect_1 = 13, effect_2 = 13, effect_3 = 6},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3},
    {item_1 = 1111, item_2 = 2222, item_3 = 3333, effect_1 = 1, effect_2 = 2, effect_3 = 3}
}
 
Top