Ir para conteúdo

[Encerrado] [Encerrado] ajude a tirar este erro do TM?


Posts Recomendados

move1. encontrei o erro nele.

Citar

local msgs = {"use ", ""}

function doAlertReady(cid, id, movename, n, cd)
    if not isCreature(cid) then return true end
    local myball = getPlayerSlotItem(cid, 8):
    local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)
    
    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
    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

local newid = 0
local name = (getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto")  and getPlayerStorageValue(mypoke,1010) or getCreatureName(mypoke)  --edited
local it = string.sub(words, 2, 3)
local cdzin = (getPlayerStorageValue(mypoke, 212123) >= 1) and "cm_move"..it.."" or "move"..it..""
local idd = getPlayerSlotItem(cid, CONST_SLOT_FEET).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)
local C ={
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move2, move = movestable[name].move2},
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move3, move = movestable[name].move3},
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move4, move = movestable[name].move4},
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move5, move = movestable[name].move5},
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move6, move = movestable[name].move6},
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move7, move = movestable[name].move7},
    {skt = movestable[getItemAttribute(idd, "skt"..it)].move8, move = movestable[name].move8},
    {move = movestable[name].move9      },
    {move = movestable[name].move10},
    {move = movestable[name].move11},
    {move = movestable[name].move12},
    {move = movestable[name].move13},
}
    if tonumber(it) > 1 and tonumber(it) < 14 then
        if tonumber(it) < 9 and getItemAttribute(idd, "skt"..it) and C[tonumber(it)].skt then  
            move = C[tonumber(it)].skt
        else
            move = C[tonumber(it)].move
        end
    end
    
    if not move then
    local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")
    local moveTable, index = getNewMoveTable(movestable[name]), 0
        -- Eu quero entender que bizarrice de loop é esse? 
        for i = 1, 12 do
            if not moveTable then
                index = i
                break
            end
        end
        if not isMega or name:find("Mega") then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
            return true
        elseif tonumber(it) ~= index then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")
            return true
        end
    local needCds = false                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.
        if needCds then
            for i = 1, 12 do
                if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then
                    return doPlayerSendCancel(cid, "para mega evoluir, os cds do pokemon devem estar carregados.")
                end
            end
        end
        move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}
    end
    
    if getPlayerLevel(cid) < move.level then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..move.level.." to use this move.")
        return true
    elseif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.")
        return true
    elseif getTileInfo(getThingPos(mypoke)).protection then
        doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")
        return true
    elseif getPlayerStorageValue(mypoke, 3894) >= 1 then
        return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v1.3
    elseif (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 true
    end

    if 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.6
            end
        end
    end
    
    if move.target == 1 then
        if not isCreature(getCreatureTarget(cid)) then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")
            return 0
        elseif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then
            return 0
        elseif getCreatureHealth(getCreatureTarget(cid)) <= 0 then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")
            return 0
        elseif not isCreature(getCreatureSummons(cid)[1]) then
            return true
        elseif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")
            return 0
        elseif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then
            return 0
        end
    end
    
    if isSleeping(mypoke) or isSilence(mypoke) then  --alterado v1.5
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")
        return 0
    else
        newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)
    end
    local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"
    if move.name == "Mega Evolution" then
        spellMessage = "Mega Evolve!"
    end
    doCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)

    local summons = getCreatureSummons(cid) --alterado v1.6
    addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)
    for i = 2, #summons do
        if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then
            docastspell(summons, move.name)        --alterado v1.6
        end
    end 
    docastspell(mypoke, move.name)
    doCreatureAddCondition(cid, playerexhaust)
    if useKpdoDlls then
        doUpdateCooldowns(cid)
    end
    return 0
end

 

esse erro que está dando no console é devido a falta da tabela cp que provavelmente não tenha no seu servidor.

Verifiquei nos arquivos e existe diversas chamadas a ela; procure em seu servidor se ela existe.

Link para o comentário
Compartilhar em outros sites

1 hora atrás, Poccnn disse:

move1. encontrei o erro nele.

 

esse erro que está dando no console é devido a falta da tabela cp que provavelmente não tenha no seu servidor.

Verifiquei nos arquivos e existe diversas chamadas a ela; procure em seu servidor se ela existe.

no move1 agora deu esse erro

 

Spoiler

[20/06/2017 19:18:51] [Error - TalkAction Interface] 

[20/06/2017 19:18:51] data/talkactions/scripts/move1.lua:onSay

[20/06/2017 19:18:51] Description: 

[20/06/2017 19:18:51] data/talkactions/scripts/move1.lua:37: attempt to index field '?' (a nil value)

[20/06/2017 19:18:51] stack traceback:

[20/06/2017 19:18:51]     data/talkactions/scripts/move1.lua:37: in function <data/talkactions/scripts/move1.lua:20>

 

encontrei a tabela cp e em meu serve ela tem outro nome vou postar as duas

 

CP do TM --obs vou postar apenas a primeira

Spoiler

cp = {

["Bulbasaur"] = {

["m1"] = {spell = "Headbutt", minLv = 20,ex = 1810001, base1 = 200, base2 = 201, dista = 1, bonus = 6,type = "normal",cd = 9},

["m2"] = {spell = "Razor Leaf",minLv = 20, ex = 400002, base1 = 230, base2 = 245, dista = 8, bonus = 2.5, type = "grass", cd = 10},

["m3"] = {spell = "Vine Whip", minLv = 20, ex = 7000004, base1 = 230, base2 = 280, dista = 2, target = "no", bonus = 4.5, type = "grass",cd = 20},

["m4"] = {spell = "Quick Attack", minLv = 20, ex = 1811001, base1 = 200, base2 = 201, dista = 1,bonus = 7, type = "normal",cd = 10},

["m5"] = {spell = "Leech Seed", minLv = 35, ex = 4308903, base1 = 18, base2 = 18, dista = 5, bonus = 1.5,type = "grass", cd = 35},

["m6"] = {spell = "Solar Beam", minLv = 40, ex = 6209804, base1 = 750, base2 = 650, dista = 100, bonus = 12, target = "no", type = "grass",cd = 60},

["m7"] = {spell = "Sleep Powder", minLv = 20, ex = 616808, base1 = 425, target = "no", base2 = 575, dista = 100, bonus = 0, type = "grass",cd = 30},

["m8"] = {spell = "Stun Spore", minLv = 25, ex = 610468, base1 = 425, target = "no", base2 = 575, dista = 100, bonus = 0, type = "grass",cd = 50},

["!cd"] = { pokenome= "Bulbasaur" , nmoves= 8 , spellm1 = "Headbutt" ,exm1=1810001,spellm2="Razor Leaf",exm2 = 400002,spellm3= "Vine Whip",exm3=7000004,spellm4 = "Quick Attack",exm4=1811001,spellm5 ="Leech Seed",exm5=4308903,spellm6="Solar Beam",exm6=6209804,spellm7= "Sleep Powder",exm7=616808,spellm8="Stun Spore",exm8=610468},

["XD"] = { descricao = "For some time after its birth, it grows by gaining nourishment from the seed on its back.",desvantagem = "Weaknesses: \n Fire/Ice/Flying/Psychic",habilidade = "Habilites:Cut\nHeadbutt",evoluction = "Bulbasaur: Level 20 \nIvysaur: Level 45\nVenusaur: Level 85",type = "is a dual-type Grass/Poison"},

},

 

do meu server

 

Spoiler

movestable = {                                                                                         

["Bulbasaur"] = {move1 = {name = "Tackle", level = 1, cd = 10, dist = 1, target = 1, f = 50, t = "normal"},

         move2 = {name = "Razor Leaf", level = 1, cd = 10, dist = 10, target = 1, f = 33, t = "grass"},

         move3 = {name = "Vine Whip", level = 1, cd = 20, dist = 1, target = 0, f = 65, t = "grass"},

         move4 = {name = "Headbutt", level = 1, cd = 15, dist = 1, target = 1, f = 70, t = "normal"},

         move5 = {name = "Leech Seed", level = 22, cd = 60, dist = 10, target = 1, f = 1, t = "grass"},

         move6 = {name = "Solar Beam", level = 30, cd = 60, dist = 1, target = 0, f = 190, t = "grass"},

         move7 = {name = "Sleep Powder", level = 28, cd = 80, dist = 1, target = 0, f = 0, t = "normal"},

         move8 = {name = "Stun Spore", level = 26, cd = 45, dist = 1, target = 0, f = 0, t = "normal"},

         move9 = {name = "Poison Powder", level = 24, cd = 45, dist = 1, target = 0, f = 0, t = "normal"},

         },

 

 

ou seja esse Cp tera que se transformar em movestable o move1.lua tera q ser modificado junto com a função (eu acho)

 

o unico move1.lua que funciona no meu servidor é este 

e a parte do TM existente no outro move1.lua tera que ser adaptada a ele

 

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 then

index = i

break

end

end

if tonumber(it) ~= index then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")

return true

end

local needCds = false                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.

if needCds then

for i = 1, 12 do

if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then

return doPlayerSendCancel(cid, "para mega evoluir os cds do pokemon devem estar carregados.")

end

end

end

move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}

end

if getPlayerLevel(cid) < move.level then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..move.level.." to use this move.")

return true

end

if getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.")

return true

end

if getTileInfo(getThingPos(mypoke)).protection then

doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")

return true

end

if getPlayerStorageValue(mypoke, 3894) >= 1 then

return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v1.3

end

if (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 true

end

if 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.6

end

end

end

if move.target == 1 then

if not isCreature(getCreatureTarget(cid)) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")

return 0

end

if getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then

return 0

end

if getCreatureHealth(getCreatureTarget(cid)) <= 0 then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")

return 0

end

if not isCreature(getCreatureSummons(cid)[1]) then

return true

end

if getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")

return 0

end

if not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then

return 0

end

end

local newid = 0

if isSleeping(mypoke) or isSilence(mypoke) then  --alterado v1.5

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")

return 0

else

newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)

end

local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"

if move.name == "Mega Evolution" then

spellMessage = "Mega Evolve!"

end

doCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)

local summons = getCreatureSummons(cid) --alterado v1.6

addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)

for i = 2, #summons do

if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then

docastspell(summons, move.name)        --alterado v1.6

end

end 

docastspell(mypoke, move.name)

doCreatureAddCondition(cid, playerexhaust)

if useKpdoDlls then

doUpdateCooldowns(cid)

end

return 0

end

 

 

Editado por Weverton Siri
Link para o comentário
Compartilhar em outros sites

move1 -- modificado

local msgs = {"use ", ""}function doAlertReady(cid, id, movename, n, cd)	if not isCreature(cid) then return true end	local myball = getPlayerSlotItem(cid, 8)	local p = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid)		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	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	endendfunction 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	endlocal mypoke = getCreatureSummons(cid)[1]	if getCreatureCondition(cid, CONDITION_EXHAUST) then return true end	if getCreatureName(mypoke) == "Evolution" then return true endlocal newid = 0local name = ''	if(getCreatureName(mypoke) == "Ditto" or getCreatureName(mypoke) == "Shiny Ditto")then	name = getPlayerStorageValue(mypoke,1010)	else name = getCreatureName(mypoke) 	endlocal it = string.sub(words, 2, 3)local cdzin = (getPlayerStorageValue(mypoke, 212123) >= 1) and "cm_move"..it.."" or "move"..it..""local idd = getPlayerSlotItem(cid, CONST_SLOT_FEET).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)local C 	[2] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move2, move = movestable[name].move2},	[3] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move3, move = movestable[name].move3},	[4] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move4, move = movestable[name].move4},	[5] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move5, move = movestable[name].move5},	[6] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move6, move = movestable[name].move6},	[7] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move7, move = movestable[name].move7},	[8] 		= {skt = movestable[getItemAttribute(idd, "skt"..it)].move8, move = movestable[name].move8},	[9] 		= {move = movestable[name].move9	  },	[10] 	= {move = movestable[name].move10},	[11] 	= {move = movestable[name].move11},	[12] 	= {move = movestable[name].move12},	[13]	= {move = movestable[name].move13},}	if tonumber(it) > 1 and tonumber(it) < 14 then		if tonumber(it) < 9 and getItemAttribute(idd, "skt"..it) and C[tonumber(it)].skt then  			move = C[tonumber(it)].skt		else			move = C[tonumber(it)].move		end	end		if not move then	local isMega = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "megaStone")	local moveTable, index = getNewMoveTable(movestable[name]), 0		-- Eu quero entender que bizarrice de loop é esse? 		for i = 1, 12 do			if not moveTable then				index = i				break			end		end		if not isMega or name:find("Mega") then			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")			return true		elseif tonumber(it) ~= index then			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your pokemon doesn't recognize this move.")			return true		end	local needCds = false                   --Coloque false se o pokémon puder mega evoluir mesmo com spells em cooldown.		if needCds then			for i = 1, 12 do				if getCD(getPlayerSlotItem(cid, 8).uid, "move"..i) > 0 then					return doPlayerSendCancel(cid, "para mega evoluir, os cds do pokemon devem estar carregados.")				end			end		end		move = {name = "Mega Evolution", level = 0, cd = 0, dist = 1, target = 0, f = 0, t = "?"}	end		if getPlayerLevel(cid) < move.level then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need be atleast level "..move.level.." to use this move.")		return true	elseif getCD(getPlayerSlotItem(cid, 8).uid, cdzin) > 0 and getCD(getPlayerSlotItem(cid, 8).uid, cdzin) < (move.cd + 2) then		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to wait "..getCD(getPlayerSlotItem(cid, 8).uid, cdzin).." seconds to use "..move.name.." again.")		return true	elseif getTileInfo(getThingPos(mypoke)).protection then		doPlayerSendCancel(cid, "Your pokemon cannot use moves while in protection zone.")		return true	elseif getPlayerStorageValue(mypoke, 3894) >= 1 then		return doPlayerSendCancel(cid, "You can't attack because you is with fear") --alterado v1.3	elseif (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 true	end	if 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.6			end		end	end		if move.target == 1 then		if not isCreature(getCreatureTarget(cid)) then			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don\'t have any targets.")			return 0		elseif getCreatureCondition(getCreatureTarget(cid), CONDITION_INVISIBLE) then			return 0		elseif getCreatureHealth(getCreatureTarget(cid)) <= 0 then			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your have already defeated your target.")			return 0		elseif not isCreature(getCreatureSummons(cid)[1]) then			return true		elseif getDistanceBetween(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid))) > move.dist then			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Get closer to the target to use this move.")			return 0		elseif not isSightClear(getThingPos(getCreatureSummons(cid)[1]), getThingPos(getCreatureTarget(cid)), false) then			return 0		end	end		if isSleeping(mypoke) or isSilence(mypoke) then  --alterado v1.5		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't do that right now.")		return 0	else		newid = setCD(getPlayerSlotItem(cid, 8).uid, cdzin, move.cd)	end	local spellMessage = msgs[math.random(#msgs)]..""..move.name.."!"	if move.name == "Mega Evolution" then		spellMessage = "Mega Evolve!"	end	doCreatureSay(cid, getPokeName(mypoke)..", "..spellMessage, TALKTYPE_SAY)	local summons = getCreatureSummons(cid) --alterado v1.6	addEvent(doAlertReady, move.cd * 1000, cid, newid, move.name, it, cdzin)	for i = 2, #summons do		if isCreature(summons) and getPlayerStorageValue(cid, 637501) >= 1 then			docastspell(summons, move.name)        --alterado v1.6		end	end 	docastspell(mypoke, move.name)	doCreatureAddCondition(cid, playerexhaust)	if useKpdoDlls then		doUpdateCooldowns(cid)	end	return 0end

 

 

Link para o comentário
Compartilhar em outros sites

2 horas atrás, Poccnn disse:

move1 -- modificado

 

 

mesmo erro n mudou nada

Spoiler

[20/06/2017 22:31:52] [Error - TalkAction Interface] 

[20/06/2017 22:31:52] data/talkactions/scripts/move1.lua:onSay

[20/06/2017 22:31:52] Description: 

[20/06/2017 22:31:52] data/talkactions/scripts/move1.lua:44: attempt to index field '?' (a nil value)

[20/06/2017 22:31:52] stack traceback:

[20/06/2017 22:31:52]     data/talkactions/scripts/move1.lua:44: in function <data/talkactions/scripts/move1.lua:22>

sabe esse move1 que eu disse acima que funciona? tu tem q pegar as partes relacionadas a TM no outro move1.lua e colocar no meu porem converter umas funções tipo o cp etc..

ou seja

essas partes do move1.lua do sistema  tem q ser colocada no meu move 1.lua

 

Spoiler

 local tmitem = getPlayerSlotItem(cid, 8):

 

 if isTM(tmitem.uid) and  getPlayerStorageValue(cid, 888) <= 0 then

local idtm = words:gsub("m", "T")

local tmspell = ""

if getTM(tmitem.uid,idtm) then

tmspell = TM[getTM(tmitem.uid,idtm)]

pokemon = tmspell

leveldopoke =  getPlayerStorageValue(sumomdonego, 1236)

elseif not pokemon then

return true

end

end

local tmspell = ""

if isTM(tmitem.uid) then

if getTM(tmitem.uid,"T1") then

tmspell = TM[getTM(tmitem.uid,"T1")]

pokemon.spellm1 = tmspell.spell

end

end

 

e tem q prestar atenção na partes que são a mesma coisa de um jeito diferente ou seja 

essas partes são as mesmas

 

 

do sistema

M1

Spoiler

if pokemon.nmoves == 1 then

local tmspell = ""

if isTM(tmitem.uid) then -- essas partes com TM tem que ser adapitadas ao meu move1.lua 

if getTM(tmitem.uid,"T1") then

tmspell = TM[getTM(tmitem.uid,"T1")]

pokemon.spellm1 = tmspell.spell

end

end

if exhaustion.get(cid, 31000) then

seconds1 = math.floor(((exhaustion.get(cid, 31000)) + 1))  

frasename = "Pokemon: "..pokemon.pokenome.."" 

frasecd = ""..pokemon.spellm1.." - m1: wait "..seconds1.." seconds."

 

else

frasename = "Pokemon: "..pokemon.pokenome.." "

frasecd = ""..pokemon.spellm1.." - m1: ready."

end

doPlayerSendTextMessage(cid, numerodamsg, ""..frasename.."\n"..frasecd.."")

end

 

 

M1 do meu server vc vai ver a diferença

Spoiler

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

 

 

M2 do sistema, presta atenção onde os TM são citados esses tms podem ser comparados aos skt do meu server

 

Spoiler

if pokemon.nmoves == 2 then ---- no meu server é it == "2"  essas diferenças que tem q ser olhadas

if isTM(tmitem.uid) then

if getTM(tmitem.uid,"T1") then

tmspell = TM[getTM(tmitem.uid,"T1")]

pokemon.spellm1 = tmspell.spell

end

if getTM(tmitem.uid,"T2") then

tmspell = TM[getTM(tmitem.uid,"T2")]

pokemon.spellm2 = tmspell.spell

end

end

if exhaustion.get(cid, 31000) then

seconds1 = math.floor(((exhaustion.get(cid, 31000)) + 1))  

frasename = "Pokemon: "..pokemon.pokenome.."" 

frasecd = ""..pokemon.spellm1.." - m1: wait "..seconds1.." seconds."

 

else

frasename = "Pokemon: "..pokemon.pokenome.." "

frasecd = ""..pokemon.spellm1.." - m1: ready."

end

if exhaustion.get(cid, 31001) then

seconds2 = math.floor(((exhaustion.get(cid, 31001)) + 1))  

frasecd2 = ""..pokemon.spellm2.." - m2: wait "..seconds2.." seconds."

 

else

frasecd2 = ""..pokemon.spellm2.." - m2: ready."

end

doPlayerSendTextMessage(cid, numerodamsg, ""..frasename.."\n"..frasecd.."\n"..frasecd2.."")

end

 

 

agora olha como é o M2 do meu server e olhe a diferença

 

Spoiler

if it == "2" then

if getItemAttribute(idd, "skt2") then  

move = movestable[getItemAttribute(idd, "skt2")].move2

else

move = movestable[name].move2

end

 

 

 

não sei como deixar mas deve ter que deixar mais ou menos assim

Spoiler

if it == "2" then

if isTM(tmitem.uid) then

if getTM(tmitem.uid,"T2") then

move = movestable [TM[getTM(tmitem.uid,"T2")]].move2

pokemon.move2= tmspell.move2

end

end

if getItemAttribute(idd, "skt2") then  

move = movestable[getItemAttribute(idd, "skt2")].move2

else

move = movestable[name].move2

end

 

 

Editado por Weverton Siri
Link para o comentário
Compartilhar em outros sites

  • 3 weeks later...
  • 4 weeks later...
Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...