Jump to content
×
×
  • Create New...
  • 0

CreatureScript Interface


Question

Versão do Servidor: TFS - 0.3.5
Tipo de Script: creaturescript
Código:
 
function onLogout(cid)
 
    if not isCreature(cid) then return true end    
    local thisitem = getPlayerSlotItem(cid, 8)
   
    if thisitem.uid <= 0 then return true end
   
    local ballName = getItemAttribute(thisitem.uid, "poke")
    local btype = getPokeballType(thisitem.itemid)
   
    ---------------------------------------------------------------
    if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then    --alterado v1.6
       if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
          BackTeam(cid)      
       end
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if getPlayerStorageValue(cid, 52480) >= 1 and getPlayerStorageValue(cid, 52481) >= 0 then
       doEndDuel(cid)
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
       local cmed2 = getCreatureSummons(cid)[1]
       local poscmed = getThingPos(cmed2)
       local cmeddir = getCreatureLookDir(cmed2)
       local namecmed = getCreatureName(cmed2)
       local hp, maxHp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1])
       --local gender = getPokemonGender(cmed2)
       doRemoveCreature(getCreatureSummons(cid)[1])
       local back = doCreateMonster(namecmed, poscmed)
       --addEvent(doCreatureSetSkullType, 150, back, gender)
       doCreatureSetLookDir(back, cmeddir)
       addEvent(doCreatureAddHealth, 100, back, hp-maxHp)
                                                                           
       -- pokemon controlador  
       local ball2 = getPlayerSlotItem(cid, 8)
       local mynewpos = getThingPos(getCreatureSummons(cid)[1])
       doRemoveCreature(getCreatureSummons(cid)[1])
       local pk2 = doSummonCreature(getItemAttribute(ball2.uid, "poke"), mynewpos)
       doConvinceCreature(cid, pk2)
       addEvent(doAdjustWithDelay, 100, cid, pk2, true, true, false)
       setPlayerStorageValue(cid, 888, -1)    
       cleanCMcds(ball2.uid)
       doCreatureSetLookDir(getCreatureSummons(cid)[1], 2)
       registerCreatureEvent(pk2, "SummonDeath")  
    end
   
    ----------------------------------------------------------------------
    local summon = getCreatureSummons(cid)[1]      
     
    if #getCreatureSummons(cid) >= 1 and thisitem.uid > 1 then
        if getPlayerStorageValue(cid, 212124) <= 0 then
           doItemSetAttribute(thisitem.uid, "hp", (getCreatureHealth(summon) / getCreatureMaxHealth(summon)))
        end                                                          
        setPlayerStorageValue(cid, 212124, 0)
        doTransformItem(thisitem.uid, pokeballs[btype].on)
        doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)
        doRemoveCreature(summon)
    end
 
    if getCreatureOutfit(cid).lookType == 814 then
        doPlayerStopWatching(cid)
    end
 
    if tonumber(getPlayerStorageValue(cid, 17000)) and getPlayerStorageValue(cid, 17000) >= 1 then  
        markFlyingPos(cid, getThingPos(cid))
    end
   
    if getPlayerStorageValue(cid, 22545) == 1 then    
       setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
       if getGlobalStorageValue(22550) <= 0 then
          endGoldenArena()          
       end
    end
 
return TRUE
end
 
-- local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
		    -- "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}

-- function onDeath(cid, deathList)

-- doRegainSpeed(cid)



	-- local owner = getCreatureMaster(cid)
	
        -- if getPlayerStorageValue(cid, 637500) >= 1 then
           -- doSendMagicEffect(getThingPos(cid), 211)
           -- doRemoveCreature(cid)
           -- return true
        -- end
        
        -- if getPlayerStorageValue(cid, 212123) >= 1 then
           -- return true
        -- end
        
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        
	-- local thisball = getPlayerSlotItem(owner, 8)
	-- local ballName = getItemAttribute(thisball.uid, "poke")
	
    -- btype = getPokeballType(thisball.itemid)

        -- if #getCreatureSummons(owner) > 1 then
           -- BackTeam(owner, getCreatureSummons(owner))      
        -- end

		-- doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        -- doTransformItem(thisball.uid, pokeballs[btype].off)

		-- doPlayerSendTextMessage(owner, 21, "Seu Pokemon Morreu.")

	-- local say = deathtexts[math.random(#deathtexts)]
		-- say = string.gsub(say, "POKENAME", getCreatureName(cid))

	-- if getPlayerStorageValue(cid, 33) <= 0 then
		-- doCreatureSay(owner, say, TALKTYPE_SAY)
	-- end

	-- doItemSetAttribute(thisball.uid, "hp", 0)
	-- if ehMonstro(deathList[1]) then
	   -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
	   -- return true
    -- end
	-- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))

    -- if useOTClient then
       -- doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
	    -- doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
		-- doPlayerSendCancel(owner, "")
    -- end

	-- doRemoveCreature(cid)
-- end	

 
local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
            "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}
 
function onDeath(cid, deathList)
 
    local owner = getCreatureMaster(cid)
   
        if getPlayerStorageValue(cid, 637500) >= 1 then
           doSendMagicEffect(getThingPos(cid), 211)
           doRemoveCreature(cid)
           return true
        end
       
        if getPlayerStorageValue(cid, 212123) >= 1 then
           return true
        end
       
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
       
    local thisball = getPlayerSlotItem(owner, 8)
    local ballName = getItemAttribute(thisball.uid, "poke")
   
    btype = getPokeballType(thisball.itemid)
 
        if #getCreatureSummons(owner) > 1 then
           BackTeam(owner, getCreatureSummons(owner))      
        end
 
        doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        doTransformItem(thisball.uid, pokeballs[btype].off)
 
        doPlayerSendTextMessage(owner, 21, "Seu pokemon desmaiou e precisa de cuidados.")
 
    local say = deathtexts[math.random(#deathtexts)]
        say = string.gsub(say, "POKENAME", getCreatureName(cid))
 
    if getPlayerStorageValue(cid, 33) <= 0 then
        doCreatureSay(owner, say, TALKTYPE_SAY)
    end
 
    -- doItemSetAttribute(thisball.uid, "hp", 0)
    -- if ehMonstro(deathList[1]) then
       -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
    -- end
    -- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))
 
    if useOTClient then
       doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
       doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
       doPlayerSendCancel(owner, "")
    end
   

    doRegainSpeed(cid)
    doRemoveCreature(cid)
 
return false
end

O erro que esta dando.


[15/04/2020 09:26:19] [Error - CreatureScript Interface] 
[15/04/2020 09:26:19] In a timer event called from: 
[15/04/2020 09:26:19] data/creaturescripts/scripts/goback.lua:onDeath
[15/04/2020 09:26:19] Description: 
[15/04/2020 09:26:20] (luaDoAddCondition) Creature not found

 

O código coloquei a cima. o Meu script que estou sendo usado.

 

Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 0

tou com a mesma falha no servidor 

 

[15/04/2020 14:14:38] [Error - CreatureScript Interface] 
[15/04/2020 14:14:38] data/creaturescripts/scripts/pokeexp.lua:onDeath
[15/04/2020 14:14:38] Description: 
[15/04/2020 14:14:38] data/creaturescripts/scripts/pokeexp.lua:83: attempt to call global 'getDamageMapPercent' (a nil value)
[15/04/2020 14:14:38] stack traceback:
[15/04/2020 14:14:38]     data/creaturescripts/scripts/pokeexp.lua:83: in function <data/creaturescripts/scripts/pokeexp.lua:42>

 

 

alguém sabe resolver ??? 

 

 

Edited by Josemir rosendo
Link to post
Share on other sites
  • 0
11 horas atrás, Fiapera disse:
Versão do Servidor: TFS - 0.3.5
Tipo de Script: creaturescript
Código:
  Mostrar conteúdo oculto


function onLogout(cid)
 
    if not isCreature(cid) then return true end    
    local thisitem = getPlayerSlotItem(cid, 8)
   
    if thisitem.uid <= 0 then return true end
   
    local ballName = getItemAttribute(thisitem.uid, "poke")
    local btype = getPokeballType(thisitem.itemid)
   
    ---------------------------------------------------------------
    if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then    --alterado v1.6
       if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
          BackTeam(cid)      
       end
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if getPlayerStorageValue(cid, 52480) >= 1 and getPlayerStorageValue(cid, 52481) >= 0 then
       doEndDuel(cid)
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
       local cmed2 = getCreatureSummons(cid)[1]
       local poscmed = getThingPos(cmed2)
       local cmeddir = getCreatureLookDir(cmed2)
       local namecmed = getCreatureName(cmed2)
       local hp, maxHp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1])
       --local gender = getPokemonGender(cmed2)
       doRemoveCreature(getCreatureSummons(cid)[1])
       local back = doCreateMonster(namecmed, poscmed)
       --addEvent(doCreatureSetSkullType, 150, back, gender)
       doCreatureSetLookDir(back, cmeddir)
       addEvent(doCreatureAddHealth, 100, back, hp-maxHp)
                                                                           
       -- pokemon controlador  
       local ball2 = getPlayerSlotItem(cid, 8)
       local mynewpos = getThingPos(getCreatureSummons(cid)[1])
       doRemoveCreature(getCreatureSummons(cid)[1])
       local pk2 = doSummonCreature(getItemAttribute(ball2.uid, "poke"), mynewpos)
       doConvinceCreature(cid, pk2)
       addEvent(doAdjustWithDelay, 100, cid, pk2, true, true, false)
       setPlayerStorageValue(cid, 888, -1)    
       cleanCMcds(ball2.uid)
       doCreatureSetLookDir(getCreatureSummons(cid)[1], 2)
       registerCreatureEvent(pk2, "SummonDeath")  
    end
   
    ----------------------------------------------------------------------
    local summon = getCreatureSummons(cid)[1]      
     
    if #getCreatureSummons(cid) >= 1 and thisitem.uid > 1 then
        if getPlayerStorageValue(cid, 212124) <= 0 then
           doItemSetAttribute(thisitem.uid, "hp", (getCreatureHealth(summon) / getCreatureMaxHealth(summon)))
        end                                                          
        setPlayerStorageValue(cid, 212124, 0)
        doTransformItem(thisitem.uid, pokeballs[btype].on)
        doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)
        doRemoveCreature(summon)
    end
 
    if getCreatureOutfit(cid).lookType == 814 then
        doPlayerStopWatching(cid)
    end
 
    if tonumber(getPlayerStorageValue(cid, 17000)) and getPlayerStorageValue(cid, 17000) >= 1 then  
        markFlyingPos(cid, getThingPos(cid))
    end
   
    if getPlayerStorageValue(cid, 22545) == 1 then    
       setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
       if getGlobalStorageValue(22550) <= 0 then
          endGoldenArena()          
       end
    end
 
return TRUE
end
 
-- local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
		    -- "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}

-- function onDeath(cid, deathList)

-- doRegainSpeed(cid)



	-- local owner = getCreatureMaster(cid)
	
        -- if getPlayerStorageValue(cid, 637500) >= 1 then
           -- doSendMagicEffect(getThingPos(cid), 211)
           -- doRemoveCreature(cid)
           -- return true
        -- end
        
        -- if getPlayerStorageValue(cid, 212123) >= 1 then
           -- return true
        -- end
        
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        
	-- local thisball = getPlayerSlotItem(owner, 8)
	-- local ballName = getItemAttribute(thisball.uid, "poke")
	
    -- btype = getPokeballType(thisball.itemid)

        -- if #getCreatureSummons(owner) > 1 then
           -- BackTeam(owner, getCreatureSummons(owner))      
        -- end

		-- doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        -- doTransformItem(thisball.uid, pokeballs[btype].off)

		-- doPlayerSendTextMessage(owner, 21, "Seu Pokemon Morreu.")

	-- local say = deathtexts[math.random(#deathtexts)]
		-- say = string.gsub(say, "POKENAME", getCreatureName(cid))

	-- if getPlayerStorageValue(cid, 33) <= 0 then
		-- doCreatureSay(owner, say, TALKTYPE_SAY)
	-- end

	-- doItemSetAttribute(thisball.uid, "hp", 0)
	-- if ehMonstro(deathList[1]) then
	   -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
	   -- return true
    -- end
	-- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))

    -- if useOTClient then
       -- doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
	    -- doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
		-- doPlayerSendCancel(owner, "")
    -- end

	-- doRemoveCreature(cid)
-- end	

 
local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
            "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}
 
function onDeath(cid, deathList)
 
    local owner = getCreatureMaster(cid)
   
        if getPlayerStorageValue(cid, 637500) >= 1 then
           doSendMagicEffect(getThingPos(cid), 211)
           doRemoveCreature(cid)
           return true
        end
       
        if getPlayerStorageValue(cid, 212123) >= 1 then
           return true
        end
       
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
       
    local thisball = getPlayerSlotItem(owner, 8)
    local ballName = getItemAttribute(thisball.uid, "poke")
   
    btype = getPokeballType(thisball.itemid)
 
        if #getCreatureSummons(owner) > 1 then
           BackTeam(owner, getCreatureSummons(owner))      
        end
 
        doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        doTransformItem(thisball.uid, pokeballs[btype].off)
 
        doPlayerSendTextMessage(owner, 21, "Seu pokemon desmaiou e precisa de cuidados.")
 
    local say = deathtexts[math.random(#deathtexts)]
        say = string.gsub(say, "POKENAME", getCreatureName(cid))
 
    if getPlayerStorageValue(cid, 33) <= 0 then
        doCreatureSay(owner, say, TALKTYPE_SAY)
    end
 
    -- doItemSetAttribute(thisball.uid, "hp", 0)
    -- if ehMonstro(deathList[1]) then
       -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
    -- end
    -- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))
 
    if useOTClient then
       doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
       doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
       doPlayerSendCancel(owner, "")
    end
   

    doRegainSpeed(cid)
    doRemoveCreature(cid)
 
return false
end

O erro que esta dando.


[15/04/2020 09:26:19] [Error - CreatureScript Interface] 
[15/04/2020 09:26:19] In a timer event called from: 
[15/04/2020 09:26:19] data/creaturescripts/scripts/goback.lua:onDeath
[15/04/2020 09:26:19] Description: 
[15/04/2020 09:26:20] (luaDoAddCondition) Creature not found

 

O código coloquei a cima. o Meu script que estou sendo usado.

 

Qual é a base que está usando?

Link to post
Share on other sites
  • 0
1 minuto atrás, Fiapera disse:

Roxy!.

 

Você pegou outro goback e colocou lá? Está usando qual banco mysql ou s3db(sqlitestudio)?

 

 

6 horas atrás, Josemir rosendo disse:

tou com a mesma falha no servidor 

 

[15/04/2020 14:14:38] [Error - CreatureScript Interface] 
[15/04/2020 14:14:38] data/creaturescripts/scripts/pokeexp.lua:onDeath
[15/04/2020 14:14:38] Description: 
[15/04/2020 14:14:38] data/creaturescripts/scripts/pokeexp.lua:83: attempt to call global 'getDamageMapPercent' (a nil value)
[15/04/2020 14:14:38] stack traceback:
[15/04/2020 14:14:38]     data/creaturescripts/scripts/pokeexp.lua:83: in function <data/creaturescripts/scripts/pokeexp.lua:42>

 

 

alguém sabe resolver ??? 

 

 

O seu problema é que está tentando chamar a função getDamageMapPercent que não tem no seu servidor, aliás são poucas pessoas que tem essa função.

Edited by Yan18
Link to post
Share on other sites
  • 0
12 horas atrás, Yan18 disse:

Você pegou outro goback e colocou lá? Está usando qual banco mysql ou s3db(sqlitestudio)?

 

 

O seu problema é que está tentando chamar a função getDamageMapPercent que não tem no seu servidor, aliás são poucas pessoas que tem essa função.

Sabe aonde consigo essa função para resolver meu problema ? 

Link to post
Share on other sites
  • 0
4 horas atrás, Josemir rosendo disse:

Sabe aonde consigo essa função para resolver meu problema ? 

É como o amigo acima falou, você vai precisar criar um tópico para o seu problema porque não tem haver com o problema do tópico dele.

 

 

17 horas atrás, Fiapera disse:

Não eu, eu baixei assim esse goback e como ele veio ja quando eu baixei, Eu estou usando em Sqlite, o servidor.

Eu estou baixando a base (novamente porque já tinha baixado mas perdi um HD rs) para dar uma olhada.

 

Link to post
Share on other sites
  • 0
16 horas atrás, Yan18 disse:

É como o amigo acima falou, você vai precisar criar um tópico para o seu problema porque não tem haver com o problema do tópico dele.

 

 

Eu estou baixando a base (novamente porque já tinha baixado mas perdi um HD rs) para dar uma olhada.

 

E ai achou alguma coisa?...

Link to post
Share on other sites
  • 0
Em 17/04/2020 em 07:54, Fiapera disse:

E ai achou alguma coisa?...

Cara, baixei, rodei e está funcionando normal. Porém tem que rodar por MySql, e vi que está rodando por Sqlite. 

Link to post
Share on other sites
  • 0
Em 15/04/2020 em 09:41, Fiapera disse:
Versão do Servidor: TFS - 0.3.5
Tipo de Script: creaturescript
Código:
  Mostrar conteúdo oculto


function onLogout(cid)
 
    if not isCreature(cid) then return true end    
    local thisitem = getPlayerSlotItem(cid, 8)
   
    if thisitem.uid <= 0 then return true end
   
    local ballName = getItemAttribute(thisitem.uid, "poke")
    local btype = getPokeballType(thisitem.itemid)
   
    ---------------------------------------------------------------
    if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 212124) <= 0 then    --alterado v1.6
       if getPlayerStorageValue(cid, 637501) == -2 or getPlayerStorageValue(cid, 637501) >= 1 then  
          BackTeam(cid)      
       end
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if getPlayerStorageValue(cid, 52480) >= 1 and getPlayerStorageValue(cid, 52481) >= 0 then
       doEndDuel(cid)
    end
    --////////////////////////////////////////////////////////////////////////////////////////--
    if #getCreatureSummons(cid) == 2 and getPlayerStorageValue(cid, 212124) >= 1 then
       local cmed2 = getCreatureSummons(cid)[1]
       local poscmed = getThingPos(cmed2)
       local cmeddir = getCreatureLookDir(cmed2)
       local namecmed = getCreatureName(cmed2)
       local hp, maxHp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1])
       --local gender = getPokemonGender(cmed2)
       doRemoveCreature(getCreatureSummons(cid)[1])
       local back = doCreateMonster(namecmed, poscmed)
       --addEvent(doCreatureSetSkullType, 150, back, gender)
       doCreatureSetLookDir(back, cmeddir)
       addEvent(doCreatureAddHealth, 100, back, hp-maxHp)
                                                                           
       -- pokemon controlador  
       local ball2 = getPlayerSlotItem(cid, 8)
       local mynewpos = getThingPos(getCreatureSummons(cid)[1])
       doRemoveCreature(getCreatureSummons(cid)[1])
       local pk2 = doSummonCreature(getItemAttribute(ball2.uid, "poke"), mynewpos)
       doConvinceCreature(cid, pk2)
       addEvent(doAdjustWithDelay, 100, cid, pk2, true, true, false)
       setPlayerStorageValue(cid, 888, -1)    
       cleanCMcds(ball2.uid)
       doCreatureSetLookDir(getCreatureSummons(cid)[1], 2)
       registerCreatureEvent(pk2, "SummonDeath")  
    end
   
    ----------------------------------------------------------------------
    local summon = getCreatureSummons(cid)[1]      
     
    if #getCreatureSummons(cid) >= 1 and thisitem.uid > 1 then
        if getPlayerStorageValue(cid, 212124) <= 0 then
           doItemSetAttribute(thisitem.uid, "hp", (getCreatureHealth(summon) / getCreatureMaxHealth(summon)))
        end                                                          
        setPlayerStorageValue(cid, 212124, 0)
        doTransformItem(thisitem.uid, pokeballs[btype].on)
        doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)
        doRemoveCreature(summon)
    end
 
    if getCreatureOutfit(cid).lookType == 814 then
        doPlayerStopWatching(cid)
    end
 
    if tonumber(getPlayerStorageValue(cid, 17000)) and getPlayerStorageValue(cid, 17000) >= 1 then  
        markFlyingPos(cid, getThingPos(cid))
    end
   
    if getPlayerStorageValue(cid, 22545) == 1 then    
       setGlobalStorageValue(22550, getGlobalStorageValue(22550)-1)
       if getGlobalStorageValue(22550) <= 0 then
          endGoldenArena()          
       end
    end
 
return TRUE
end
 
-- local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
		    -- "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}

-- function onDeath(cid, deathList)

-- doRegainSpeed(cid)



	-- local owner = getCreatureMaster(cid)
	
        -- if getPlayerStorageValue(cid, 637500) >= 1 then
           -- doSendMagicEffect(getThingPos(cid), 211)
           -- doRemoveCreature(cid)
           -- return true
        -- end
        
        -- if getPlayerStorageValue(cid, 212123) >= 1 then
           -- return true
        -- end
        
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        
	-- local thisball = getPlayerSlotItem(owner, 8)
	-- local ballName = getItemAttribute(thisball.uid, "poke")
	
    -- btype = getPokeballType(thisball.itemid)

        -- if #getCreatureSummons(owner) > 1 then
           -- BackTeam(owner, getCreatureSummons(owner))      
        -- end

		-- doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        -- doTransformItem(thisball.uid, pokeballs[btype].off)

		-- doPlayerSendTextMessage(owner, 21, "Seu Pokemon Morreu.")

	-- local say = deathtexts[math.random(#deathtexts)]
		-- say = string.gsub(say, "POKENAME", getCreatureName(cid))

	-- if getPlayerStorageValue(cid, 33) <= 0 then
		-- doCreatureSay(owner, say, TALKTYPE_SAY)
	-- end

	-- doItemSetAttribute(thisball.uid, "hp", 0)
	-- if ehMonstro(deathList[1]) then
	   -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
	   -- return true
    -- end
	-- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))

    -- if useOTClient then
       -- doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
	    -- doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
		-- doPlayerSendCancel(owner, "")
    -- end

	-- doRemoveCreature(cid)
-- end	

 
local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
            "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}
 
function onDeath(cid, deathList)
 
    local owner = getCreatureMaster(cid)
   
        if getPlayerStorageValue(cid, 637500) >= 1 then
           doSendMagicEffect(getThingPos(cid), 211)
           doRemoveCreature(cid)
           return true
        end
       
        if getPlayerStorageValue(cid, 212123) >= 1 then
           return true
        end
       
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
       
    local thisball = getPlayerSlotItem(owner, 8)
    local ballName = getItemAttribute(thisball.uid, "poke")
   
    btype = getPokeballType(thisball.itemid)
 
        if #getCreatureSummons(owner) > 1 then
           BackTeam(owner, getCreatureSummons(owner))      
        end
 
        doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        doTransformItem(thisball.uid, pokeballs[btype].off)
 
        doPlayerSendTextMessage(owner, 21, "Seu pokemon desmaiou e precisa de cuidados.")
 
    local say = deathtexts[math.random(#deathtexts)]
        say = string.gsub(say, "POKENAME", getCreatureName(cid))
 
    if getPlayerStorageValue(cid, 33) <= 0 then
        doCreatureSay(owner, say, TALKTYPE_SAY)
    end
 
    -- doItemSetAttribute(thisball.uid, "hp", 0)
    -- if ehMonstro(deathList[1]) then
       -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
    -- end
    -- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))
 
    if useOTClient then
       doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
       doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
       doPlayerSendCancel(owner, "")
    end
   

    doRegainSpeed(cid)
    doRemoveCreature(cid)
 
return false
end

O erro que esta dando.


[15/04/2020 09:26:19] [Error - CreatureScript Interface] 
[15/04/2020 09:26:19] In a timer event called from: 
[15/04/2020 09:26:19] data/creaturescripts/scripts/goback.lua:onDeath
[15/04/2020 09:26:19] Description: 
[15/04/2020 09:26:20] (luaDoAddCondition) Creature not found

 

O código coloquei a cima. o Meu script que estou sendo usado.

 

caso ainda esteja com problema...

 

 

procura a função onDeath no arquivo goback do creatures e apague somente a função onDeath e coloca essa no lugar:

 

 

 

function onDeath(cid, deathList)
 
    local owner = getCreatureMaster(cid)
   
        if getPlayerStorageValue(cid, 637500) >= 1 then
           doSendMagicEffect(getThingPos(cid), 211)
           doRemoveCreature(cid)
           return true
        end
       
        if getPlayerStorageValue(cid, 212123) >= 1 then
           return true
        end
       
        -- ////////////////////////////////////////////////////////////////////////////////////////--
        -- checkDuel(owner)                                                                          
        -- ////////////////////////////////////////////////////////////////////////////////////////--
       
    local thisball = getPlayerSlotItem(owner, 8)
    local ballName = getItemAttribute(thisball.uid, "poke")
   
    btype = getPokeballType(thisball.itemid)
 
        if #getCreatureSummons(owner) > 1 then
           BackTeam(owner, getCreatureSummons(owner))      
        end
		doUpdatePokemonsBar(owner)
        doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
        doTransformItem(thisball.uid, pokeballs[btype].off)
 
        doPlayerSendTextMessage(owner, 21, "Seu pokemon desmaiou e precisa de cuidados.")
		doUpdatePokemonsBar(owner)
    local say = deathtexts[math.random(#deathtexts)]
        say = string.gsub(say, "POKENAME", getCreatureName(cid))
 
    if getPlayerStorageValue(cid, 33) <= 0 then
        doCreatureSay(owner, say, TALKTYPE_SAY)
    end


    if getPlayerStorageValue(cid, 171833) >= 1 then

        doPlayerSendCancel(cid, "You cant logout during sleeping.")

        return false

        end
 
    -- doItemSetAttribute(thisball.uid, "hp", 0)
    -- if ehMonstro(deathList[1]) then
       -- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
    -- end
    -- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))
 
    if useOTClient then
       doPlayerSendCancel(owner, '12//,hide')      --alterado v1.7
       doPlayerSendCancel(owner, "pGS,".."0".."|"..getItemAttribute(thisball.uid, "ballorder").."|"..getPokeName(cid))
       doPlayerSendCancel(owner, "")
    end
   

    doRegainSpeed(cid)
    doRemoveCreature(cid)
 
return false
end

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now