narutoxDDDD 2 Postado Outubro 25, 2010 Share Postado Outubro 25, 2010 Está dando erro logo nessa parte... "if is Summon(pokemon) then" espero que me ajudem =D function onUse(cid, item, fromPos, itemEx, toPos) local pokemon = itemEx.uid local pokemons = { {"Bulbasaur", "1.txt", 11395, 20, 100, 99101}, {"Squirtle", "2.txt", 11401, 20, 500, 99102}, } for _,n in pairs(pokemons) do local Dex = io.open('data/pokedex/' .. n[2],'r') if isSummon(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then doShowTextDialog(cid, n[3], Dex:read("*all")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.") doPlayerAddExperience(cid, n[5]) setPlayerStorageValue(cid, n[6], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then doShowTextDialog(cid, n[3], Dex:read("*all")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need level " .. n[4] .. " to unlock this pokemon.") elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then doShowTextDialog(cid, n[3], Dex:read("*all")) return true end elseif isMonster(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) <= 0 then doShowTextDialog(cid, n[3], Dex:read("*all")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.") doPlayerAddExperience(cid, n[5]) setPlayerStorageValue(cid, n[6], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then doShowTextDialog(cid, n[3], Dex:read("*all")) return true end end end end ++REP Para quem ajudar Link para o comentário Compartilhar em outros sites More sharing options...
joaohd 200 Postado Outubro 25, 2010 Share Postado Outubro 25, 2010 O servidor não possui esta função. Tente esta: function isSummon(uid) return isCreature(uid) and getCreatureMaster(uid) ~= uid or false end flw Link para o comentário Compartilhar em outros sites More sharing options...
kevinloko 10 Postado Outubro 25, 2010 Share Postado Outubro 25, 2010 Ei cara tu podia passar o script pra nóis né Link para o comentário Compartilhar em outros sites More sharing options...
narutoxDDDD 2 Postado Outubro 29, 2010 Autor Share Postado Outubro 29, 2010 apocarai Tem como vc editar o scripter contendo essa edição? não entendi onde editar ==D Vou disponibilizar ele pro xtibia se no caso de funcionar =D Link para o comentário Compartilhar em outros sites More sharing options...
joaohd 200 Postado Outubro 29, 2010 Share Postado Outubro 29, 2010 Tente: function isSummon(uid) return isCreature(uid) and getCreatureMaster(uid) ~= uid or false end function onUse(cid, item, fromPos, itemEx, toPos) local pokemon = itemEx.uid local pokemons = { {"Bulbasaur", "1.txt", 11395, 20, 100, 99101}, {"Squirtle", "2.txt", 11401, 20, 500, 99102}, } for _,n in pairs(pokemons) do local Dex = io.open('data/pokedex/' .. n[2],'r') if isSummon(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then doShowTextDialog(cid, n[3], Dex:read("*all")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.") doPlayerAddExperience(cid, n[5]) setPlayerStorageValue(cid, n[6], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then doShowTextDialog(cid, n[3], Dex:read("*all")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need level " .. n[4] .. " to unlock this pokemon.") elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then doShowTextDialog(cid, n[3], Dex:read("*all")) return true end elseif isMonster(pokemon) then if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) <= 0 then doShowTextDialog(cid, n[3], Dex:read("*all")) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.") doPlayerAddExperience(cid, n[5]) setPlayerStorageValue(cid, n[6], 1) elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then doShowTextDialog(cid, n[3], Dex:read("*all")) return true end end end flw Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados