Postado Abril 6, 2022 3 anos Autor Em 05/04/2022 em 09:52, FeeTads disse: tenta assim mano --by Richi~ -- 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 = {7364} local eweapons = {{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 doRemoveItem(cid, gems[a], 1) doPlayerAddItem(cid, egems[a], 1) doPlayerAddMana(cid,-mana) doPlayerAddSoul(cid,-soul) doSendMagicEffect(frompos,39) else doPlayerSendCancel(cid,"You dont have mana or soul points.") end else return 2 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(cid, egems[b], 1) doRemoveItem(cid, weapons[c], 1) doPlayerAddItem(cid, eweapons[c], 1) doSendMagicEffect(frompos,39) doRemoveItem(item.uid,1) else doPlayerSendCancel(cid,"You can't enchanted this.") end else return 0 end return true end desculpa a demora, pois estava viajando. testei aqui e nao esta transformando o item, mas usa o ruby e aparece o efeito no player [Error - Action Interface] data/actions/scripts/other/enchant.lua:onUse Description: (luaDoPlayerAddItem) Item not found Editado Abril 6, 2022 3 anos por Carlinhous1996 (veja o histórico de edições)
Postado Abril 6, 2022 3 anos 6 horas atrás, Carlinhous1996 disse: (luaDoPlayerAddItem) Item not found 6 horas atrás, Carlinhous1996 disse: doPlayerAddItem(cid, eweapons[c], 1) coloca assim aqui doPlayerAddItem(cid, eweapons[c][b], 1)
Postado Abril 6, 2022 3 anos Autor 1 hora atrás, FeeTads disse: coloca assim aqui doPlayerAddItem(cid, eweapons[c][b], 1) muito obrigado pelo seu comprometimento! esta mais perto que nunca kkkkk está funcionando tudo "perfeitamento" está adicionando a eweapons, removendo a egems, mas nao esta removendo a weapons [Error - Action Interface] data/actions/scripts/other/enchant.lua:onUse Description: (luaDoRemoveItem) Item not found Editado Abril 6, 2022 3 anos por Carlinhous1996 (veja o histórico de edições)
Postado Abril 7, 2022 3 anos 13 horas atrás, Carlinhous1996 disse: doRemoveItem(cid, weapons[c], 1) coloca isso no lugar doRemoveItem(cid, item2.uid, 1)
Postado Abril 7, 2022 3 anos Autor 12 horas atrás, FeeTads disse: coloca isso no lugar doRemoveItem(cid, item2.uid, 1) Spoiler --by Richi~ -- 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 = {7364} local eweapons = {{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 doRemoveItem(cid, gems[a], 1) doPlayerAddItem(cid, egems[a], 1) doPlayerAddMana(cid,-mana) doPlayerAddSoul(cid,-soul) doSendMagicEffect(frompos,39) else doPlayerSendCancel(cid,"You dont have mana or soul points.") end else return 2 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(cid, egems[b], 1) doRemoveItem(cid, item2.uid, 1) doPlayerAddItem(cid, eweapons[c][b], 1) doSendMagicEffect(frompos,39) doRemoveItem(item.uid,1) else doPlayerSendCancel(cid,"You can't enchanted this.") end else return 0 end return true end Mais uma vez agradeço a voce! esta funcionando tudo perfeito, mas esta dando esse erro na distro sabe por que? [Error - Action Interface] data/actions/scripts/other/enchant.lua:onUse Description: (luaDoRemoveItem) Item not found ela está assim no meu serve com todos os items Spoiler --by Richi~ -- 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 doRemoveItem(cid, gems[a], 1) doPlayerAddItem(cid, egems[a], 1) doPlayerAddMana(cid,-mana) doPlayerAddSoul(cid,-soul) doSendMagicEffect(frompos,39) else doPlayerSendCancel(cid,"You dont have mana or soul points.") end else return 2 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(cid, egems[b], 1) doRemoveItem(cid, item2.uid, 1) doPlayerAddItem(cid, eweapons[c][b], 1) doSendMagicEffect(frompos,39) doRemoveItem(item.uid,1) else doPlayerSendCancel(cid,"You can't enchanted this.") end else return 0 end return true end Editado Abril 7, 2022 3 anos por Carlinhous1996 (veja o histórico de edições)
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.