• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

Lua Merge items with lever (Action)

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
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 =...

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
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
Hey, have you tried to make the script only look for 1 item required for fusion?

It's hard to find the problem with no errors since you have 500 lines of code xD

I would suggest trying to find what's wrong with a smaller and more simple script so you know what's causing it.
 
OP
OP
snuckles

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
Location
Hong Kong
Hey, have you tried to make the script only look for 1 item required for fusion?

It's hard to find the problem with no errors since you have 500 lines of code xD

I would suggest trying to find what's wrong with a smaller and more simple script so you know what's causing it.

Hello, thanks for your message, the truth was I tried in a thousand ways for almost a full day and I could not solve it, so I asked for help here, because I modified I made it small until I created a small one with only 2 objects to combine and even if it does not work , I have the theory that the problem is the "get thing from pos" but I'm not sure, I've tried to verify what the problem is but I can't find it.
 

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
Hello, thanks for your message, the truth was I tried in a thousand ways for almost a full day and I could not solve it, so I asked for help here, because I modified I made it small until I created a small one with only 2 objects to combine and even if it does not work , I have the theory that the problem is the "get thing from pos" but I'm not sure, I've tried to verify what the problem is but I can't find it.
So with the current script, what actually happens when you pull the lever? Do the items required get removed? Are you getting any effects to the set positions?

I'm not home to test but it does not hurt to get more information as we may come to a solution.
 
OP
OP
snuckles

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
Location
Hong Kong
So with the current script, what actually happens when you pull the lever? Do the items required get removed? Are you getting any effects to the set positions?

I'm not home to test but it does not hurt to get more information as we may come to a solution.

Nothing happens nothing, just does not react the lever does not move.
 

Avaji

Premium User
Premium User
Joined
Mar 18, 2010
Messages
32
Reaction score
22
Try a quick thing for me,

Right above your "return 0" add a simple print statement "did not find any items".
As well as inside of most of your "if" statements you can simply add a print statement along the lines of "found item X and item Y"

Then we can see what's going on real quick
 

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
Hey, I got some free time at home and tried your script, apparently it did not work as intended..

I have however been trying some shorter code and it seems to be working, take a look at this:
Lua:
function onUse(cid, item, frompos, item2, topos)

item1pos = {x=1026, y=1024, z=7, stackpos=255} --item1pos
item2pos = {x=1027, y=1025, z=7, stackpos=255} --item2pos
item3pos = {x=1027, y=1024, z=7, stackpos=255} --item3pos
item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)


if item.itemid == 1945 then
    if item1.itemid == 2160 and item2.itemid == 2152 then
        doRemoveItem(item1.uid,1)
        doSendMagicEffect(item1pos,13)
        doRemoveItem(item2.uid,1)
        doSendMagicEffect(item2pos,13)
        doTransformItem(item.uid,1946)
        doCreateItem(2160,100, item3pos)
        doSendMagicEffect(item3pos,6)
        doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)
        end
elseif item.itemid == 1946 then
    doTransformItem(item.uid, 1945)
end
end

Try it, im pretty sure you can come to a solution from there on out :)
 
OP
OP
snuckles

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
Location
Hong Kong
Well I was really trying literally in many ways until I tried to recreate the script again and it did not work, the truth is, I do not know what happens because it does not present errors in the console so I do not know what is really happening, I need help from some expert that manages to modify the entire script and make all the objects work and you can continue adding even more objects to merge.
 

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
Well I was really trying literally in many ways until I tried to recreate the script again and it did not work, the truth is, I do not know what happens because it does not present errors in the console so I do not know what is really happening, I need help from some expert that manages to modify the entire script and make all the objects work and you can continue adding even more objects to merge.
Did you try the script above? It works for me and it should just be a matter of adding the correct location & item id. Does it not work for you?

If you wish to have all items you listed then you can add them with elseif statements.
 
OP
OP
snuckles

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
Location
Hong Kong
If I did what you told me, I even added if the "elseif" but it didn't work once you add more in the list the script doesn't work anymore. It is very strange the truth
 

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
If I did what you told me, I even added if the "elseif" but it didn't work once you add more in the list the script doesn't work anymore. It is very strange the truth
I think you might be messing up with the code, have you scripted before? :) I'll take a look at it tomorrow. Hopefully someone else might be able to help you before then.
 

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
Hey,

I've added another item required to do the fusion just to show a way of doing things, also elseif statement which allows you to combine other items.. you can follow that example if you wish to add more fusions.

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

item1pos = {x=1035, y=1025, z=7, stackpos=255} --item1pos
item2pos = {x=1037, y=1025, z=7, stackpos=255} --item2pos
item3pos = {x=1035, y=1027, z=7, stackpos=255} --item3pos
item4pos = {x=1037, y=1027, z=7, stackpos=255} --item3pos
item5pos = {x=1036, y=1026, z=7, stackpos=255} --item3pos

item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)
item4 = getThingfromPos(item4pos)
item5 = getThingfromPos(item5pos)


if item.itemid == 1945 then
    if item1.itemid == 2493 and item2.itemid == 2493 and item3.itemid == 2493 and item3.itemid == 2493 then
        doRemoveItem(item1.uid,1)
        doSendMagicEffect(item1pos,13)
        doRemoveItem(item2.uid,1)
        doSendMagicEffect(item2pos,13)
        doTransformItem(item.uid,1946)
        doRemoveItem(item3.uid,1)
        doSendMagicEffect(item3pos,13)
        doCreateItem(2160,100, item5pos)
        doSendMagicEffect(item5pos,6)
        doSendMagicEffect(item4pos,13)
        doRemoveItem(item4.uid,1)
        doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)
    elseif item1.itemid == 2494 and item2.itemid == 2494 and item3.itemid == 2494 and item3.itemid == 2494 then
        doRemoveItem(item1.uid,1)
        doSendMagicEffect(item1pos,13)
        doRemoveItem(item2.uid,1)
        doSendMagicEffect(item2pos,13)
        doTransformItem(item.uid,1946)
        doRemoveItem(item3.uid,1)
        doSendMagicEffect(item3pos,13)
        doSendMagicEffect(item4pos,13)
        doCreateItem(2123,1, item5pos)
        doSendMagicEffect(item5pos,6)
        doRemoveItem(item4.uid,1)
        doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)
    end
elseif item.itemid == 1946 then
    doTransformItem(item.uid, 1945)
end
end

Before lever usage:

1_1.png

After:
1_2.png

The script is quite ugly but it works! :)
You might want to find other ways of doing things if you wish to have a bigger script as i think 500 lines is too much and code can be shorter.
 
OP
OP
snuckles

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
Location
Hong Kong
Hey,

I've added another item required to do the fusion just to show a way of doing things, also elseif statement which allows you to combine other items.. you can follow that example if you wish to add more fusions.

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

item1pos = {x=1035, y=1025, z=7, stackpos=255} --item1pos
item2pos = {x=1037, y=1025, z=7, stackpos=255} --item2pos
item3pos = {x=1035, y=1027, z=7, stackpos=255} --item3pos
item4pos = {x=1037, y=1027, z=7, stackpos=255} --item3pos
item5pos = {x=1036, y=1026, z=7, stackpos=255} --item3pos

item1 = getThingfromPos(item1pos)
item2 = getThingfromPos(item2pos)
item3 = getThingfromPos(item3pos)
item4 = getThingfromPos(item4pos)
item5 = getThingfromPos(item5pos)


if item.itemid == 1945 then
    if item1.itemid == 2493 and item2.itemid == 2493 and item3.itemid == 2493 and item3.itemid == 2493 then
        doRemoveItem(item1.uid,1)
        doSendMagicEffect(item1pos,13)
        doRemoveItem(item2.uid,1)
        doSendMagicEffect(item2pos,13)
        doTransformItem(item.uid,1946)
        doRemoveItem(item3.uid,1)
        doSendMagicEffect(item3pos,13)
        doCreateItem(2160,100, item5pos)
        doSendMagicEffect(item5pos,6)
        doSendMagicEffect(item4pos,13)
        doRemoveItem(item4.uid,1)
        doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)
    elseif item1.itemid == 2494 and item2.itemid == 2494 and item3.itemid == 2494 and item3.itemid == 2494 then
        doRemoveItem(item1.uid,1)
        doSendMagicEffect(item1pos,13)
        doRemoveItem(item2.uid,1)
        doSendMagicEffect(item2pos,13)
        doTransformItem(item.uid,1946)
        doRemoveItem(item3.uid,1)
        doSendMagicEffect(item3pos,13)
        doSendMagicEffect(item4pos,13)
        doCreateItem(2123,1, item5pos)
        doSendMagicEffect(item5pos,6)
        doRemoveItem(item4.uid,1)
        doCreatureSay(cid, "Fusion!", TALKTYPE_ORANGE_1)
    end
elseif item.itemid == 1946 then
    doTransformItem(item.uid, 1945)
end
end

Before lever usage:

View attachment 63309

After:
View attachment 63311

The script is quite ugly but it works! :)
You might want to find other ways of doing things if you wish to have a bigger script as i think 500 lines is too much and code can be shorter.
Try to use your script as it is and it won't let me, it tells me that this object cannot be used and it does not present errors in the console and the lever does not move, it does not work, it must be because we use different servers, you may not be here using OTX or are you using another version of TFS I'm not sure.
Post automatically merged:

I think I'll give up, there is no solution to this, I don't know what the problem is.
 

SorketROrk

Well-Known Member
Joined
Oct 14, 2020
Messages
152
Solutions
1
Reaction score
69
Location
Sweden
You also need to add a line in actions.xml to make it look for the script and actionid, I assume you already did this? If not then do it.

Else it must be something else yeah since it works for me TFS 1.3~
 

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,245
Solutions
545
Reaction score
4,488
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 = tile_2:getTopDownItem()

    if not item_1 or not item_2 then
        player:say("One of the fusion tiles is missing an item.", TALKTYPE_MONSTER_SAY, false, nil, toPosition)
        return true
    end
 
    local item_1_itemId = item_1:getId()
    local item_2_itemId = item_2:getId()
 
    for i = 1, #config do
        if config[i].item_1 == item_1_itemId and config[i].item_2 == item_2_itemId or config[i].item_2 == item_1_itemId and config[i].item_1 == item_2_itemId then
            item:transform(1946)
            item_1:remove(1)
            item_2:remove(1)
            Game.createItem(config[i].item_3, 1, positions.position_3)
            positions.position_1:sendMagicEffect(config[i].effect_1)
            positions.position_2:sendMagicEffect(config[i].effect_2)
            positions.position_3:sendMagicEffect(config[i].effect_3)
            player:say("Fusion!", TALKTYPE_MONSTER_SAY, false, nil, positions.position_3)
            return true
        end
    end
 
    player:say("No matching fusion recipe found.", TALKTYPE_MONSTER_SAY, false, nil, toPosition)
    return true
end
 
Solution
OP
OP
snuckles

snuckles

New Member
Joined
Apr 4, 2009
Messages
70
Reaction score
3
Location
Hong Kong
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.
 
Top