Postado Junho 7, 2017 8 anos bom dia, tarde ou noite eu estou com um problema em um script neste script eu tenho partes de 4 systemas que sãoditto system, smeargle system, mega evolution system e TM system porem eu não estou conseguindo fazer funcionar os 4 eu consigo deixar apenas 3 funcionando ditto system, smeargle system & mega evolution systemou ditto system, smeargle system & TM system não consigo deixar o TM e o MEGA funcionando juntos então separei em 2 scripts diferentes e vou postar os 2, um que funciona o TM e outro que funcione o Mega espero que alguem possa me ajudar juntando os 2 script de uma forma que funcione todos os 4 system DESDE JA OBRIGADO OBS: OS SCRIPTS TEM A DIFERENÇA DE MENOS DE 20 LINHAS SÃO PRATICAMENTE O MESMO COM MEGA FUNCIONANDO Spoiler local msgs = {"use ", ""} function doAlertReady(cid, id, movename, n, cd) if not isCreature(cid) then return true end local myball = getPlayerSlotItem(cid, 8) if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(myball.uid).." - "..movename.." (m"..n..") is ready!") return true end local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid) if not p or #p <= 0 then return true end for a = 1, #p do if getItemAttribute(p[a], cd) == "cd:"..id.."" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!") return true end end end function onSay(cid, words, param, channel) if param ~= "" then return true end if string.len(words) > 3 then return true end if #getCreatureSummons(cid) == 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.") return 0 end local mypoke = getCreatureSummons(cid)[1] if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end if getCreatureName(mypoke) == "Evolution" then return true end if getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto" then name = getPlayerStorageValue(mypoke, 1010) --edited else name = getCreatureName(mypoke) end local it = string.sub(words, 2, 3) local idd = getPlayerSlotItem(cid, 8).uid local move = (getCreatureName(mypoke) == "Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1) or (getCreatureName(mypoke) == "Shiny Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1) if getPlayerStorageValue(mypoke, 212123) >= 1 then cdzin = "cm_move"..it.."" else cdzin = "move"..it.."" end if it == "2" then if getItemAttribute(idd, "skt2") then move = movestable[getItemAttribute(idd, "skt2")].move2 else move = movestable[name].move2 end elseif it == "3" then if getItemAttribute(idd, "skt3") then move = movestable[getItemAttribute(idd, "skt3")].move3 else move = movestable[name].move3 end elseif it == "4" then if getItemAttribute(idd, "skt4") then move = movestable[getItemAttribute(idd, "skt4")].move4 else move = movestable[name].move4 end elseif it == "4" then if getItemAttribute(idd, "skt4") then move = movestable[getItemAttribute(idd, "skt4")].move4 else move = movestable[name].move4 end elseif it == "5" then if getItemAttribute(idd, "skt5") then move = movestable[getItemAttribute(idd, "skt5")].move5 else move = movestable[name].move5 end elseif it == "6" then if getItemAttribute(idd, "skt6") then move = movestable[getItemAttribute(idd, "skt6")].move6 else move = movestable[name].move6 end elseif it == "7" then if getItemAttribute(idd, "skt7") then move = movestable[getItemAttribute(idd, "skt7")].move7 else move = movestable[name].move7 end elseif it == "8" then if getItemAttribute(idd, "skt8") then move = movestable[getItemAttribute(idd, "skt8")].move8 else move = movestable[name].move8 end elseif it == "9" then move = movestable[name].move9 elseif it == "10" then move = movestable[name].move10 elseif it == "11" then move = movestable[name].move11 elseif it == "12" then move = movestable[name].move12 elseif it == "13" then move = movestable[name].move13 end if not move then local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone") if not isMega or name:find("Mega") then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.") return true end local moveTable, index = getNewMoveTable(movestable[name]), 0 for i = 1, 12 do if not moveTable thenindex = ibreakendendif tonumber(it) ~= index thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")return trueendlocal needCds = false --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.if needCds thenfor i = 1, 12 doif getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 thenreturn doPlayerSendCancel(cid, "para mega evoluir os cds do pokemon devem estar carregados.")endendendmove = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}endif getPlayerLevel(cid) < move.level thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..move.level.." to use this move.")return trueendif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.")return trueendif getTileInfo(getThingPos(mypoke)).protection thendoPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")return trueendif getPlayerStorageValue(mypoke, 3894) >= 1 thenreturn doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v1.3endif (move.name == "Team Slice" or move.name == "Team Claw") and #getCreatureSummons(cid) < 2 then doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")return trueendif isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) then local target = getCreatureTarget(cid) if math.random(1, 100) <= passivesChances["Evasion"][getCreatureName(target)] then if isCreature(getMasterTarget(target)) then --alterado v1.6 doSendMagicEffect(getThingPos(target), 211)doSendAnimatedText(getThingPos(target), "TOO BAD", 215) doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false)doSendMagicEffect(getThingPos(target), 211)doFaceCreature(target, getThingPos(mypoke)) return true --alterado v1.6endendendif move.target == 1 thenif not isCreature(getCreatureTarget(cid)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")return 0endif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) thenreturn 0endif getCreatureHealth(getCreatureTarget(cid)) <= 0 thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")return 0endif not isCreature(getCreatureSummons(cid)[1]) thenreturn trueendif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")return 0endif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) thenreturn 0endendlocal newid = 0if isSleeping(mypoke) or isSilence(mypoke) then --alterado v1.5doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")return 0elsenewid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)endlocal spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"if move.name == "Mega Evolution" thenspellMessage = "Mega Evolve!"enddoCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)local summons = getCreatureSummons(cid) --alterado v1.6addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)for i = 2, #summons doif isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 thendocastspell(summons, move.name) --alterado v1.6endend docastspell(mypoke, move.name)doCreatureAddCondition(cid, playerexhaust)if useKpdoDlls thendoUpdateCooldowns(cid)endreturn 0end COM TM FUNCIONANDO Spoiler local msgs = {"use ", ""}function doAlertReady(cid, id, movename, n, cd)if not isCreature(cid) then return true endlocal myball = getPlayerSlotItem(cid, 8)if myball.itemid > 0 and getItemAttribute(myball.uid, cd) == "cd:"..id.."" thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(myball.uid).." - "..movename.." (m"..n..") is ready!")return trueendlocal p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)if not p or #p <= 0 then return true endfor a = 1, #p doif getItemAttribute(p[a], cd) == "cd:"..id.."" thenif isInArray({"m1", "m2", "m3"}, n) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (t"..n..") is ready!")elsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getPokeballName(p[a]).." - "..movename.." (m"..n..") is ready!")endreturn trueendendendfunction onSay(cid, words, param, channel)if param ~= "" then return true endif string.len(words) > 3 then return true endif #getCreatureSummons(cid) == 0 thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need a pokemon to use moves.")return 0endlocal mypoke = getCreatureSummons(cid)[1]if getCreatureCondition(cid, CONDITION_EXHAUST) then return true endif getCreatureName(mypoke) == "Evolution" then return true endlocal name = getCreatureName(mypoke) == "Ditto" and getPlayerStorageValue(mypoke, 1010) or getCreatureName(mypoke)local it = string.sub(words, 2, 3)local move = movestable[name].move1local idd = getPlayerSlotItem(cid, 8).uidlocal move = (getCreatureName(mypoke) == "Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1) or (getCreatureName(mypoke) == "Shiny Smeargle" and getItemAttribute(idd, "skt1") and movestable[getItemAttribute(idd, "skt1")].move1 or movestable[name].move1)if getPlayerStorageValue(mypoke, 212123) >= 1 thencdzin = "cm_move"..it..""elsecdzin = "move"..it..""endif it == "2" thenif getItemAttribute(idd, "skt2") then move = movestable[getItemAttribute(idd, "skt2")].move2elsemove = movestable[name].move2endelseif it == "3" thenif getItemAttribute(idd, "skt3") then move = movestable[getItemAttribute(idd, "skt3")].move3elsemove = movestable[name].move3endelseif it == "4" thenif getItemAttribute(idd, "skt4") then move = movestable[getItemAttribute(idd, "skt4")].move4elsemove = movestable[name].move4endelseif it == "5" thenif getItemAttribute(idd, "skt5") then move = movestable[getItemAttribute(idd, "skt5")].move5elsemove = movestable[name].move5endelseif it == "6" thenif getItemAttribute(idd, "skt6") then move = movestable[getItemAttribute(idd, "skt6")].move6elsemove = movestable[name].move6endelseif it == "7" thenif getItemAttribute(idd, "skt7") then move = movestable[getItemAttribute(idd, "skt7")].move7elsemove = movestable[name].move7endelseif it == "8" thenif getItemAttribute(idd, "skt8") then move = movestable[getItemAttribute(idd, "skt8")].move8elsemove = movestable[name].move8endelseif it == "9" thenmove = movestable[name].move9elseif it == "10" thenmove = movestable[name].move10elseif it == "11" thenmove = movestable[name].move11elseif it == "12" thenmove = movestable[name].move12elseif it == "13" thenmove = movestable[name].move13elseif it == "m1" thenmove = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm1") or falseelseif it == "m2" thenmove = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm2") or falseelseif it == "m3" thenmove = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "tm3") or falseendif isInArray({1,2,3,4,5,6,7,8,9,10,11,12,13}, it) thenmLevel = move.levelmCD = move.cdmName = move.namemTarget = move.targetmDist = move.distelsem = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "t"..it.."")mLevel = tmList[m].levelmCD = tmList[m].cdmName = mmTarget = tmList[m].targetmDist = tmList[m].distendif not move thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")return trueendif getPlayerLevel(cid) < mLevel thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..mLevel.." to use this move.")return trueendif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (mCD + 2) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..mName.." again.")return 0endif getTileInfo(getThingPos(mypoke)).protection thendoPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")return 0endif getPlayerStorageValue(mypoke, 3894) >= 1 thenreturn doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v2.3endif (mName == "Team Slice" or mName == "Team Claw") and #getCreatureSummons(cid) < 2 then --alterado v2.5doPlayerSendCancel(cid, "Your pokemon need be in a team for use this move!")return 0endif isCreature(getCreatureTarget(cid)) and isInArray(specialabilities["evasion"], getCreatureName(getCreatureTarget(cid))) and math.random(1, 100) <= 10 thenlocal target = getCreatureTarget(cid) if isCreature(getMasterTarget(target)) thendoSendMagicEffect(getThingPos(target), 211)doSendAnimatedText(getThingPos(target), "TOO BAD", 215) doTeleportThing(target, getClosestFreeTile(target, getThingPos(mypoke)), false)doSendMagicEffect(getThingPos(target), 211)doFaceCreature(target, getThingPos(mypoke))return trueend endif mTarget == 1 thenif not isCreature(getCreatureTarget(cid)) thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")return 0endif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) thenreturn 0endif getCreatureHealth(getCreatureTarget(cid)) <= 0 thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")return 0endif not isCreature(getCreatureSummons(cid)[1]) thenreturn trueendif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > mDist thendoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")return 0endif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) thenreturn 0endendlocal newid = 0if isSleeping(mypoke) or isSilence(mypoke) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")return 0elsenewid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, mCD)enddoCreatureSay(cid, ""..getPokeName(mypoke)..", "..msgs[math.random(#msgs)]..""..mName.."!", TALKTYPE_SAY)local summons = getCreatureSummons(cid)addEvent(doAlertReady, mCD * 1000, cid, newid, mName, it, cdzin)for i = 2, #summons doif isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 thendocastspell(summons, mName)endenddocastspell(mypoke, mName)doCreatureAddCondition(cid, playerexhaust)if useKpdoDlls thendoUpdateCooldowns(cid)endreturn 0end @Vodkart eu vi que voce juntou 2 script pro leki e te marquei espero q possa me ajudar tb Editado Junho 10, 2017 8 anos por wevertonvrb (veja o histórico de edições)
Postado Junho 11, 2017 8 anos @wevertonvrb o problema não é merge os dois systems, e sim saber qual é qual no meio disso, poste somente os codes que não estão funcionando juntos, para que eu ou outro ache o conflito existente entre os dois.
Postado Junho 12, 2017 8 anos Autor 23 horas atrás, KotZletY disse: @wevertonvrb o problema não é merge os dois systems, e sim saber qual é qual no meio disso, poste somente os codes que não estão funcionando juntos, para que eu ou outro ache o conflito existente entre os dois. eu acabei de adicionar o TM system o resto já tinha e o script esta inteiro apos adicionar o TM estava tudo ok mas quando fui usar o Mega vi que o Mega não estava mais funcionando então retirei o TM e o mega volto a funcionar então separei 2 arquivos um com mega e outro com TM os 2 não funcionam juntos e os outros ja tinham o conflito é entre o mega e o TM por isso postei os 2 e espero que alguém possa me ajudar com isso
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.