eu quero que quando estes itens esteja nestas posições, os itens sejam removidos, quando era so 2 itens funcionava otimo, mas ai eu tive que aumentar o numero.
e da como se algum item estivese no lugar errado.
eu coloco eles numa fileira assim O,O,O,O,O,O
function onUse(cid, item, frompos, item2, topos)
local func = doCreateNpc
db1pos = {x=757,y=826,z=7,stackpos=1} -- pozycja pierwszej sciany
db2pos = {x=758,y=826,z=7,stackpos=1} -- pozycja drugiej sciany
db3pos = {x=759,y=826,z=7,stackpos=1} -- pozycja drugiej sciany
db4pos = {x=760,y=826,z=7,stackpos=1} -- pozycja drugiej sciany
db5pos = {x=761,y=826,z=7,stackpos=1} -- pozycja drugiej sciany
db6pos = {x=762,y=826,z=7,stackpos=1} -- pozycja drugiej sciany
npcpos = {x=759,y=827,z=7,stackpos=1} -- pozycja drugiej sciany
getpiece0 = getThingfromPos(npcpos) -- onde ficara o NPC
getpiece1 = getThingfromPos(db1pos)
getpiece2 = getThingfromPos(db2pos)
getpiece3 = getThingfromPos(db3pos)
getpiece4 = getThingfromPos(db4pos)
getpiece5 = getThingfromPos(db5pos)
getpiece6 = getThingfromPos(db6pos)
if item.uid == 7054 and item.itemid == 1945 and getpiece1.itemid == 10309 and getpiece2.itemid == 10310 and getpiece3.itemid == 10311 and getpiece4.itemid == 10312 and getpiece5.itemid == 10314 and getpiece6.itemid == 10315 then
doRemoveItem(getpiece1.uid,10309)
doRemoveItem(getpiece2.uid,10310)
doRemoveItem(getpiece3.uid,10311)
doRemoveItem(getpiece4.uid,10312)
doRemoveItem(getpiece5.uid,10314)
doRemoveItem(getpiece6.uid,10315)
doTransformItem(item.uid,item.itemid+1)
doCreateNpc('shenron', npcpos)
elseif item.uid == 7054 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendTextMessage(cid,22,"You need right and left keys to transform key.")
end
return 1
end
Script original.
function onUse(cid, item, frompos, item2, topos)
local func = doCreateNpc
mwallpos = {x=757,y=825,z=7,stackpos=1} -- pozycja pierwszej sciany
mwall1pos = {x=758,y=825,z=7,stackpos=1} -- pozycja drugiej sciany
mwall2pos = {x=759,y=825,z=7,stackpos=1} -- pozycja drugiej sciany
getpiece1 = getThingfromPos(mwallpos)
getpiece2 = getThingfromPos(mwall1pos)
getpiece3 = getThingfromPos(mwall2pos)
if item.uid == 7054 and item.itemid == 1945 and getpiece1.itemid == 10309 and getpiece2.itemid == 10310 then
doRemoveItem(getpiece1.uid,10309)
doRemoveItem(getpiece2.uid,10310)
doTransformItem(item.uid,item.itemid+1)
doCreateNpc('shenron', mwall2pos)
elseif item.uid == 7054 and item.itemid == 1946 then
doTransformItem(item.uid,item.itemid-1)
else
doPlayerSendTextMessage(cid,22,"You need right and left keys to transform key.")
end
return 1
end