KaboFlow29 26 Postado Abril 27, 2013 Share Postado Abril 27, 2013 [27/04/2013 00:21:28] [Error - LuaScriptInterface::loadFile] data/actions/scripts/pokeball.lua:67: 'end' expected (to close 'function' at line 8) near 'else' [27/04/2013 00:21:28] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/pokeball.lua) [27/04/2013 00:21:28] data/actions/scripts/pokeball.lua:67: 'end' expected (to close 'function' at line 8) near 'else' Please Ajuda... Link para o comentário https://xtibia.com/forum/topic/213120-encerrado-ajuda-pokeball/ Compartilhar em outros sites More sharing options...
kttallan 319 Postado Abril 29, 2013 Share Postado Abril 29, 2013 Manin Mostra O Catch Como Disse Sempre Que Vocé Por Uma Duvida Vocé Bota O Scripter Pra Ajudar. Link para o comentário https://xtibia.com/forum/topic/213120-encerrado-ajuda-pokeball/#findComment-1513045 Compartilhar em outros sites More sharing options...
KaboFlow29 26 Postado Abril 30, 2013 Autor Share Postado Abril 30, 2013 local notAllowed = {"Ferumbras", "Demon"} local storage = { status = 25650, pokeName = 25651 } local actionid_used = 7510 function onUse(cid, item, fromPos, item2, toPos) local pokeballStatus = getPlayerStorageValue(cid, storage.status) local pokeName = getPlayerStorageString(cid, storage.pokeName) pos = getPlayerPosition(cid) pos.stackpos = 0 if pokeballStatus == -1 then toPos.stackpos = 253 local pokeThing = getThingfromPos(toPos) if isCreature(pokeThing.uid) == TRUE then if isPlayer(pokeThing.uid) == FALSE then local pokename_ = getCreatureName(pokeThing.uid) if item.actionid ~= actionid_used then -- local maxHealth = 400 -- local creatureHealth = getCreatureHealth(pokeThing.uid) -- local divNum = (string.len(maxHealth)-1)^2 -- local result = math.floor((creatureHealth/divNum)/10) -- local chance = math.random(1, math.random(4, math.random(7, math.max(result, 7)))) -- if chance == result then if isInTable(notAllowed, pokename_) == TRUE then doPlayerSendCancel(cid, "You cannot catch this creature") else setPlayerStorageString(cid, storage.pokeName, pokename_) doRemoveCreature(pokeThing.uid) doSendDistanceShoot(fromPos, toPos, 37) setPlayerStorageValue(cid, storage.status, 1) doSetItemSpecialDescription(item.uid, "it contains a " .. pokename_ .. ".") doSetItemActionId(item.uid, actionid_used) end -- else -- doSendMagicEffect(fromPos, 2) -- doPlayerSendCancel(cid, "The Pokemom Escaped") -- end elseif item.actionid == actionid_used and pokename_ == pokeName then doPlayerSay(cid, pokeName .. " Back!!", TALKTYPE_SAY) doRemoveCreature(pokeThing.uid) doSetItemSpecialDescription(item.uid, "it contains a " .. pokename_ .. ".") setPlayerStorageValue(cid, storage.status, 1) doSendDistanceShoot(fromPos, toPos, 37) else doSendMagicEffect(fromPos, 2) doPlayerSendCancel(cid, "This pokeball is already used") end else doPlayerSendCancel(cid, "You cannot catch this creature") end else doPlayerSendCancel(cid, "Creature not found") end elseif pokeballStatus == 1 then summons = getCreatureSummons(cid) -- if #summons >= 2 then -- doPlayerSendCancel(cid, "You cannot call more pokemons") -- else doConvinceSummon(cid, pokeName, 0, toPos) doSendDistanceShoot(fromPos, toPos, 37) doPlayerSay(cid, pokeName .. " Go!!", TALKTYPE_SAY) setPlayerStorageValue(cid, storage.status, -1) doSetItemSpecialDescription(item.uid, "it is empty.") -- end end else return 1 end function isInTable(t, val) for _, v in pairs(t) do if v == val then return TRUE end end return LUA_ERROR end Link para o comentário https://xtibia.com/forum/topic/213120-encerrado-ajuda-pokeball/#findComment-1513343 Compartilhar em outros sites More sharing options...
kttallan 319 Postado Abril 30, 2013 Share Postado Abril 30, 2013 Tenta Esse Aki local notAllowed = {"Ferumbras", "Demon"} local storage = { status = 25650, pokeName = [ { Monster.xml } ] } local actionid_used = 7510[/size][/size][/font] [font=comic sans ms,cursive][size=5][size=4]function onUse(cid, item, fromPos, item2, toPos) local pokeballStatus = getPlayerStorageValue(cid, storage.status) local pokeName = getPlayerStorageString(cid, storage.pokeName) pos = getPlayerPosition(cid) pos.stackpos = 0 if pokeballStatus == -1 then toPos.stackpos = 253 local pokeThing = getThingfromPos(toPos) if isCreature(pokeThing.uid) == TRUE then if isPlayer(pokeThing.uid) == FALSE then local pokename_ = getCreatureName(pokeThing.uid) if item.actionid ~= actionid_used then -- local maxHealth = 400 -- local creatureHealth = getCreatureHealth(pokeThing.uid) -- local divNum = (string.len(maxHealth)-1)^2 -- local result = math.floor((creatureHealth/divNum)/10) -- local chance = math.random(1, math.random(4, math.random(7, math.max(result, 7)))) -- if chance == result then if isInTable(notAllowed, pokename_) == TRUE then doPlayerSendCancel(cid, "You cannot catch this creature") else setPlayerStorageString(cid, storage.pokeName, pokename_) doRemoveCreature(pokeThing.uid) doSendDistanceShoot(fromPos, toPos, 37) setPlayerStorageValue(cid, storage.status, 1) doSetItemSpecialDescription(item.uid, "it contains a " .. pokename_ .. ".") doSetItemActionId(item.uid, actionid_used) end -- else -- doSendMagicEffect(fromPos, 2) -- doPlayerSendCancel(cid, "The Pokemom Escaped") -- end elseif item.actionid == actionid_used and pokename_ == pokeName then doPlayerSay(cid, pokeName .. " Back!!", TALKTYPE_SAY) doRemoveCreature(pokeThing.uid) doSetItemSpecialDescription(item.uid, "it contains a " .. pokename_ .. ".") setPlayerStorageValue(cid, storage.status, 1) doSendDistanceShoot(fromPos, toPos, 37) else doSendMagicEffect(fromPos, 2) doPlayerSendCancel(cid, "This pokeball is already used") end else doPlayerSendCancel(cid, "You cannot catch this creature") end else doPlayerSendCancel(cid, "Creature not found") end elseif pokeballStatus == 1 then summons = getCreatureSummons(cid) -- if #summons >= 2 then -- doPlayerSendCancel(cid, "You cannot call more pokemons") -- else doConvinceSummon(cid, pokeName, 0, toPos) doSendDistanceShoot(fromPos, toPos, 37) doPlayerSay(cid, pokeName .. " Go!!", TALKTYPE_SAY) setPlayerStorageValue(cid, storage.status, -1) doSetItemSpecialDescription(item.uid, "it is empty.") -- end end else[/size][/size][/font] [font=comic sans ms,cursive][size=5][size=4]return 1 end[/size][/size][/font] [font=comic sans ms,cursive][size=5][size=4]function isInTable(t, val) for _, v in pairs(t) do if v == val then return TRUE end end return LUA_ERROR end outra pergunta qual e o seu serve e pda ? Link para o comentário https://xtibia.com/forum/topic/213120-encerrado-ajuda-pokeball/#findComment-1513422 Compartilhar em outros sites More sharing options...
KaboFlow29 26 Postado Maio 1, 2013 Autor Share Postado Maio 1, 2013 PDA V1.8_f Creditos - Slicer, Stylo Maldoso Modicicaoo. Link para o comentário https://xtibia.com/forum/topic/213120-encerrado-ajuda-pokeball/#findComment-1513932 Compartilhar em outros sites More sharing options...
Stigal 585 Postado Abril 21, 2018 Share Postado Abril 21, 2018 A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta. + Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda. * Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado. Link para o comentário https://xtibia.com/forum/topic/213120-encerrado-ajuda-pokeball/#findComment-1734344 Compartilhar em outros sites More sharing options...
Posts Recomendados