Postado Fevereiro 26, 2015 10 anos estou com dificuldade para entender como funciona uma tabela com for alguem poderia me ajudar assim estou querendo colocar para se attr['deadly'] = { attr = 'extraAttack', base = 'attack', name = 'Extra Attack', types = {SWORD, CLUB, AXE}, percent = {10, 20}, tipo = {1} } o tipo for igual a attr['quick'] = { attr = 'attackSpeed', name = 'Attack Speed', percent = {4, 8}, types = {WAND,DISTANCE,SWORD,CLUB,AXE}, tipo = {1} } esse tipo entao n add ele a parte do script q usa isso creio eu q seja essa for m, n in pairs(attr) do if( not table.find(used, m) and ( ( table.find(n.types, SWORD) and f.attack ~= 0 and f.weaponType == WEAPON_SWORD ) or ( table.find(n.types, CLUB) and f.attack ~= 0 and f.weaponType == WEAPON_CLUB ) or ( table.find(n.types, AXE) and f.attack ~= 0 and f.weaponType == WEAPON_AXE ) or ( table.find(n.types, DISTANCE) and f.weaponType == WEAPON_DIST and f.ammoType ~= 0 ) or ( table.find(n.types, ARMOR) and f.armor ~= 0 and f.wieldPosition ~= CONST_SLOT_NECKLACE ) or ( table.find(n.types, SHIELD) and f.defense ~= 0 and f.weaponType == WEAPON_SHIELD ) or ( table.find(n.types, WAND) and f.weaponType == WEAPON_WAND ) or ( table.find(n.types, RING) and f.wieldPosition == CONST_SLOT_RING ) or ( table.find(n.types, NECKLACE) and f.wieldPosition == CONST_SLOT_NECKLACE ) ))then table.insert(cur, m) end end
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.