Ir para conteúdo
  • 0

[Resolvido] Erro script attempt to compare boolean with number


Hisoka Fail2

Pergunta

Estou com esse erro no meu pokeexp.lua : attempt to compare boolean with number

 

Ai está a linha do erro:

Citar

if getPlayerLevel(pk) <= 1 then

 

 

Eu já pesquise e sei que o erro é devido a isso : <= 1 (que está comparando algo), mas não sei se simplesmente remover isso, irá de fato corrigir o erro, ou se irá piorar tudo.

 

 

Script completo:

Citar

local function playerAddExp(cid, exp)
if isPlayer(cid) == TRUE then
    doPlayerAddExp(cid, exp)
    doSendAnimatedText(getThingPos(cid), exp, 215)
else
return true
end
end
 
 
function onDeath(cid, corpse, deathList)
       
    --if not isCreature(cid) then return true end
    if isSummon(cid) or not deathList or getCreatureName(cid) == "Evolution" then return true end --alterado v1.8
 

    local givenexp = getWildPokemonExp(cid)
    ---local killer = getItemAttribute(corpse.uid, "corpseowner")  
 
if givenexp > 0 then
for a = 1, #deathList do
local pk = deathList[a]
---
local list = getSpectators(getThingPosWithDebug(pk), 30, 30, false)
if isCreature(pk) then
   local expTotal = math.floor(givenexp)
   local party = getPartyMembers(pk)
   if isInParty(pk) and getPlayerStorageValue(pk, 4875498) <= -1 then
      expTotal = math.floor(expTotal/#party)         --alterado v1.6.1
      for i = 1, #party do
          if isInArray(list, party) then          
if getPlayerLevel(pk) <= 1 then
             playerAddExp(party, expTotal * 200)  
elseif getPlayerLevel(pk) >= 51 and getPlayerLevel(pk) <= 75 then
             playerAddExp(party, expTotal * 130)
elseif getPlayerLevel(pk) >= 76 and getPlayerLevel(pk) <= 100 then
             playerAddExp(party, expTotal * 80)
elseif getPlayerLevel(pk) >= 101 and getPlayerLevel(pk) <= 150 then
             playerAddExp(party, expTotal * 40)
elseif getPlayerLevel(pk) >= 151 and getPlayerLevel(pk) <= 250 then
             playerAddExp(party, expTotal * 20)
elseif getPlayerLevel(pk) >= 251 and getPlayerLevel(pk) <= 350 then
             playerAddExp(party, expTotal * 10)
elseif getPlayerLevel(pk) >= 351 then
             playerAddExp(party, expTotal * 5)
             end
          end
      end
   elseif not isInParty(pk) then
if getPlayerLevel(pk) <= 1 then ERRO
playerAddExp(pk, math.floor(200 * givenexp))
elseif getPlayerLevel(pk) >= 51 and getPlayerLevel(pk) <= 75 then
playerAddExp(pk, math.floor(130 * givenexp))
elseif getPlayerLevel(pk) >= 76 and getPlayerLevel(pk) <= 100 then
playerAddExp(pk, math.floor(80 * givenexp))
elseif getPlayerLevel(pk) >= 101 and getPlayerLevel(pk) <= 150 then
playerAddExp(pk, math.floor(40 * givenexp))
elseif getPlayerLevel(pk) >= 151 and getPlayerLevel(pk) <= 250 then
playerAddExp(pk, math.floor(20 * givenexp))
elseif getPlayerLevel(pk) >= 251 and getPlayerLevel(pk) <= 350 then
playerAddExp(pk, math.floor(10 * givenexp))
elseif getPlayerLevel(pk) >= 351 then
playerAddExp(pk, math.floor(5 * givenexp))
return true end  
   end      
end
end
end
 
    if isNpcSummon(cid) then
        local master = getCreatureMaster(cid)
        doSendMagicEffect(getThingPos(cid), getPlayerStorageValue(cid, 10000))
        doCreatureSay(master, getPlayerStorageValue(cid, 10001), 1)
        doRemoveCreature(cid)
    return false
    end
if corpse.itemid ~= 0 then   --alterado v1.8
   doItemSetAttribute(corpse.uid, "level", getPokemonLevel(cid))
end
return true
end

 

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...