Ir para conteúdo

Featured Replies

Postado

 

Erro :

 

      data/lib/amoebaTask.lua:28: in function 'taskKills'
        data/creaturescripts/scripts/amoebaTaskCreature.lua:9: in function <data/creaturescripts/scripts/amoebaTaskCreature.lua:1>

 

   Quando um player ataca um mostro da task ela retorna esse erro no otx, e o mostro fica bugado e não MORRE :(
 

 

Creaturescript:

function onKill(cid, target, lastHit)
    
    if not isMonster(target) then
        return true
    end
    
    for _, tasks in pairs(amoebaTask) do
        if isInArray(tasks.creatures, getCreatureName(target)) then
            if taskKills(cid, tasks.storagecount) < tasks.count then
                doPlayerSetStorageValue(cid, tasks.storagecount, taskKills(cid, tasks.storagecount)+1)
                break
            end
        end
    end
    return true
end 

LINHA DO ERRO :

if taskKills(cid, tasks.storagecount) < tasks.count then

LIB :

function taskKills(cid, storage) 
    local kills = getPlayerStorageValue(cid, storage)
    return kills < 0 and 0 or kills
end 

LINHA DO ERRO :

return kills < 0 and 0 or kills

 

Por favor alguém pode me ajudar a arrumar isso ?

Postado
function taskKills(cid, storage) 
    return getPlayerStorageValue(cid, storage) <= 0 and 0 or getPlayerStorageValue(cid, storage)
end 

 

esse vc altera na lib, deixa a função assim

 

 

---------------

 

function onKill(cid, target, lastHit)    
    if isPlayer(target) or not isPlayer(cid) then
        return true
    end    
    for _, tasks in pairs(amoebaTask) do
        if isInArray(tasks.creatures, getCreatureName(target)) then
	local storage = taskKills(cid, tasks.storagecount)
            if storage < tasks.count then
                setPlayerStorageValue(cid, tasks.storagecount, storage+1)
                break
            end
        end
    end
    return true
end 

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor
  Em 20/08/2018 em 12:32, Vodkart disse:

function taskKills(cid, storage) 
    return getPlayerStorageValue(cid, storage) <= 0 and 0 or getPlayerStorageValue(cid, storage)
end 

 

esse vc altera na lib, deixa a função assim

 

 

---------------

 


function onKill(cid, target, lastHit)    
    if isPlayer(target) or not isPlayer(cid) then
        return true
    end    
    for _, tasks in pairs(amoebaTask) do
        if isInArray(tasks.creatures, getCreatureName(target)) then
	local storage = taskKills(cid, tasks.storagecount)
            if storage < tasks.count then
                setPlayerStorageValue(cid, tasks.storagecount, storage+1)
                break
            end
        end
    end
    return true
end 

 

infelizmente continua o mesmo erro :/

dei rep pela ajuda

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo