Postado Abril 7, 2022 3 anos Solução function onUse(cid, item, frompos, item2, topos) local gems = {2146, 2147, 2149, 2150} local egems = {7759, 7760, 7761, 7762} local altars = {{7508, 7509, 7510, 7511}, {7504, 7505, 7506, 7507}, {7516, 7517, 7518, 7519}, {7512, 7513, 7514, 7515}} local weapons = {7406, 2454, 7415, 8905, 2342, 2138, 10221, 10218, 10220, 10219, 8908, 8906, 8907, 8909, 7766, 7747, 7857, 7872, 7772, 7753, 7863, 7878, 7775, 7756, 7866, 7881, 7364, 7839, 7840, 7850, 7838} local eweapons = {{7766, 7747, 7857, 7872}, {7772, 7753, 7863, 7878}, {7775, 7756, 7866, 7881}, {8907, 8906, 8909, 8908}, {2343, 2343, 2343, 2343}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {8907, 8906, 8909, 8908}, {8907, 8906, 8909, 8908}, {8907, 8906, 8909, 8908}, {8907, 8906, 8909, 8908}, {7766, 7747, 7857, 7872}, {7766, 7747, 7857, 7872}, {7766, 7747, 7857, 7872}, {7766, 7747, 7857, 7872}, {7772, 7753, 7863, 7878}, {7772, 7753, 7863, 7878}, {7772, 7753, 7863, 7878}, {7772, 7753, 7863, 7878}, {7775, 7756, 7866, 7881}, {7775, 7756, 7866, 7881}, {7775, 7756, 7866, 7881}, {7775, 7756, 7866, 7881}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}} local type = item.type if type == 0 then type = 1 end local mana = 3000 * type local soul = 40 * type if isInArray(gems, item.itemid) == TRUE then for aa=1, #gems do if item.itemid == gems[aa] then a=aa end end if isInArray(altars[a], item2.itemid)== TRUE then if getPlayerMana(cid) >= mana and getPlayerSoul(cid) >= soul then doTransformItem(item.uid, egems[a]) doPlayerAddMana(cid,-mana) doPlayerAddSoul(cid,-soul) doSendMagicEffect(frompos,39) else doPlayerSendCancel(cid,"You dont have mana or soul points.") end end elseif isInArray(egems, item.itemid)== TRUE then for bb=1, #egems do if item.itemid == egems[bb] then b=bb end end if isInArray(weapons, item2.itemid)== TRUE then for cc=1, #weapons do if item2.itemid == weapons[cc] then c=cc end end doRemoveItem(item.uid, 1) doRemoveItem(item2.uid) doPlayerAddItem(cid, eweapons[c][b], 1) doSendMagicEffect(frompos,39) doRemoveItem(item.uid,1) else doPlayerSendCancel(cid,"You can't enchanted this.") end end return true end [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Abril 8, 2022 3 anos Em 07/04/2022 em 19:25, Vodkart disse: doRemoveItem(item.uid,1) Em 07/04/2022 em 19:25, Vodkart disse: doRemoveItem(item.uid, 1) não vai bugar deixar 2 doRemove ali? procurando o msm item? e doRemove pode ir sem o "cid"? realmente eu não sei, eu sempre uso o cid
Postado Abril 8, 2022 3 anos Autor Em 07/04/2022 em 19:25, Vodkart disse: function onUse(cid, item, frompos, item2, topos) local gems = {2146, 2147, 2149, 2150} local egems = {7759, 7760, 7761, 7762} local altars = {{7508, 7509, 7510, 7511}, {7504, 7505, 7506, 7507}, {7516, 7517, 7518, 7519}, {7512, 7513, 7514, 7515}} local weapons = {7406, 2454, 7415, 8905, 2342, 2138, 10221, 10218, 10220, 10219, 8908, 8906, 8907, 8909, 7766, 7747, 7857, 7872, 7772, 7753, 7863, 7878, 7775, 7756, 7866, 7881, 7364, 7839, 7840, 7850, 7838} local eweapons = {{7766, 7747, 7857, 7872}, {7772, 7753, 7863, 7878}, {7775, 7756, 7866, 7881}, {8907, 8906, 8909, 8908}, {2343, 2343, 2343, 2343}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {10220, 10218, 10219, 10221}, {8907, 8906, 8909, 8908}, {8907, 8906, 8909, 8908}, {8907, 8906, 8909, 8908}, {8907, 8906, 8909, 8908}, {7766, 7747, 7857, 7872}, {7766, 7747, 7857, 7872}, {7766, 7747, 7857, 7872}, {7766, 7747, 7857, 7872}, {7772, 7753, 7863, 7878}, {7772, 7753, 7863, 7878}, {7772, 7753, 7863, 7878}, {7772, 7753, 7863, 7878}, {7775, 7756, 7866, 7881}, {7775, 7756, 7866, 7881}, {7775, 7756, 7866, 7881}, {7775, 7756, 7866, 7881}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}, {7839, 7840, 7850, 7838}} local type = item.type if type == 0 then type = 1 end local mana = 3000 * type local soul = 40 * type if isInArray(gems, item.itemid) == TRUE then for aa=1, #gems do if item.itemid == gems[aa] then a=aa end end if isInArray(altars[a], item2.itemid)== TRUE then if getPlayerMana(cid) >= mana and getPlayerSoul(cid) >= soul then doTransformItem(item.uid, egems[a]) doPlayerAddMana(cid,-mana) doPlayerAddSoul(cid,-soul) doSendMagicEffect(frompos,39) else doPlayerSendCancel(cid,"You dont have mana or soul points.") end end elseif isInArray(egems, item.itemid)== TRUE then for bb=1, #egems do if item.itemid == egems[bb] then b=bb end end if isInArray(weapons, item2.itemid)== TRUE then for cc=1, #weapons do if item2.itemid == weapons[cc] then c=cc end end doRemoveItem(item.uid, 1) doRemoveItem(item2.uid) doPlayerAddItem(cid, eweapons[c][b], 1) doSendMagicEffect(frompos,39) doRemoveItem(item.uid,1) else doPlayerSendCancel(cid,"You can't enchanted this.") end end return true end Obrigado Em 08/04/2022 em 11:20, FeeTads disse: não vai bugar deixar 2 doRemove ali? procurando o msm item? e doRemove pode ir sem o "cid"? realmente eu não sei, eu sempre uso o cid Valeu mesmo pela ajuda
Postado Abril 8, 2022 3 anos Em 08/04/2022 em 11:20, FeeTads disse: não vai bugar deixar 2 doRemove ali? procurando o msm item? e doRemove pode ir sem o "cid"? realmente eu não sei, eu sempre uso o cid e se o item estiver no chão? vai procurar o item nessa criatura ID (cid) e não vai encontrar, ai da esse erro no LOG no distro... [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.