Ir para conteúdo

Featured Replies

Postado

Peguei um script aqui no tibiaking de pvp enforced, ao matar voce ganha level, dai dei umas modificadas neles, e ta aparecendo esse erro
 

image.png.56adb5be771fa13db3cc137f5fac23b8.png.e59a792cd6c991996eaa06f0d2057203.png

Script

Spoiler

function onKill(cid, target, lastHit)

local exp1 = 1
local exp11 = 2
local exp2 = 3
local exp22 = 6
local exp3 = 9
local exp33 = 18
local exp4 = 27
local exp44 = 54
local exp5 = 81
local exp55 = 162
local exp6 = 243
local lvl = getPlayerLevel(target)

 

    if isPlayer(cid) and isPlayer(target) then
        if getPlayerIp(cid) == getPlayerIp(target) then 
        doCreatureSay(cid, "Voce nao recebe EXP por matar MC", TALKTYPE_ORANGE_1)
        return true
        end
        if getPlayerLevel(target) > 1 and getPlayerLevel(target) < 5000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "10000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp1 * lvl)

        elseif getPlayerLevel(target) > 5000 and getPlayerLevel(target) < 10000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "20000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp11 * lvl)
        
        elseif getPlayerLevel(target) > 10000 and getPlayerLevel(target) < 15000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "30000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp2 * lvl)
        
        elseif getPlayerLevel(target) > 15000 and getPlayerLevel(target) < 20000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "40000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp22 * lvl)
    
        elseif getPlayerLevel(target) > 20000 and getPlayerLevel(target) < 25000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "50000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp3 * lvl)

        elseif getPlayerLevel(target) > 25000 and getPlayerLevel(target) < 30000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "60000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp33 * lvl)

        elseif getPlayerLevel(target) > 30000 and getPlayerLevel(target) < 35000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "70000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp4 * lvl)

        elseif getPlayerLevel(target) > 35000 and getPlayerLevel(target) < 40000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "80000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp44 * lvl)

        elseif getPlayerLevel(target) > 40000 and getPlayerLevel(target) < 45000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "90000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp5 * lvl)

        elseif getPlayerLevel(target) > 45000 and getPlayerLevel(target) < 50000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "100000000", 210)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp55 * lvl)

        elseif getPlayerLevel(target) > 50000 and getPlayerLevel(target) < 90000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "110000000", 210)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp6 * lvl)
end
    end
    return true
end

       <event type="kill" name="pvpenf" event="script" value="pvpenf.lua"/>

 


Alguem me ajuda pf?

Editado por poko360 (veja o histórico de edições)

  • Respostas 10
  • Visualizações 900
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • @poko360 Ta registrado no login.lua também? Vê ai:   Se ainda tiver erro no script de cima, testa esse: Nova tag: <event type="death" name="pvpenf" event="script" value="pvpenf.lua

  • consegui fazer de um jeito aqui, peguei de um codigo que voce botou ali , e montei um aqui que nao da erro na distro, de qualquer forma mt obrigado REP+

  • O erro é bem simples, tem uma linha que seria essa:   local lvl = getPlayerLevel(target)   deveria estar depois de checar se realmente o target é player, porque no caso se atacar um m

Posted Images

Postado

@poko360 Testa ai.

 

Spoiler

function onKill(cid, target, lastHit)

local exp1 = 1
local exp11 = 2
local exp2 = 3
local exp22 = 6
local exp3 = 9
local exp33 = 18
local exp4 = 27
local exp44 = 54
local exp5 = 81
local exp55 = 162
local exp6 = 243
local check = getCreatureTarget(cid)
local lvl = getPlayerLevel(check)

    if isPlayer(cid) and isCreature(check) then
        if getPlayerIp(cid) == getPlayerIp(check) then 
		doCreatureSay(cid, "Voce nao recebe EXP por matar MC", TALKTYPE_ORANGE_1)
		return true
        end
        if getPlayerLevel(check) > 1 and getPlayerLevel(check) < 5000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "10000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp1 * lvl)

        elseif getPlayerLevel(check) > 5000 and getPlayerLevel(check) < 10000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "20000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp11 * lvl)
        
        elseif getPlayerLevel(check) > 10000 and getPlayerLevel(check) < 15000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "30000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp2 * lvl)
        
        elseif getPlayerLevel(check) > 15000 and getPlayerLevel(check) < 20000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "40000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp22 * lvl)
    
        elseif getPlayerLevel(check) > 20000 and getPlayerLevel(check) < 25000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "50000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp3 * lvl)

        elseif getPlayerLevel(check) > 25000 and getPlayerLevel(check) < 30000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "60000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp33 * lvl)

        elseif getPlayerLevel(check) > 30000 and getPlayerLevel(check) < 35000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "70000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp4 * lvl)

        elseif getPlayerLevel(check) > 35000 and getPlayerLevel(check) < 40000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "80000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp44 * lvl)

        elseif getPlayerLevel(check) > 40000 and getPlayerLevel(check) < 45000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "90000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp5 * lvl)

        elseif getPlayerLevel(check) > 45000 and getPlayerLevel(check) < 50000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "100000000", 210)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp55 * lvl)

        elseif getPlayerLevel(check) > 50000 and getPlayerLevel(check) < 90000 and getPlayerLevel(cid) > 1 then
            doSendAnimatedText(getPlayerPosition(cid), "110000000", 210)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp6 * lvl)
end
    end
    return true
end

 

 

Postado
function onKill(cid, target, lastHit)

local exp1 = 1
local exp11 = 2
local exp2 = 3
local exp22 = 6
local exp3 = 9
local exp33 = 18
local exp4 = 27
local exp44 = 54
local exp5 = 81
local exp55 = 162
local exp6 = 243
local target = getCreatureTarget(cid)
local lvl = getPlayerLevel(target)

 

    if isPlayer(cid) and isPlayer(target) then
        if getPlayerIp(cid) == getPlayerIp(target) then 
        doCreatureSay(cid, "Voce nao recebe EXP por matar MC", TALKTYPE_ORANGE_1)
        return true
        end
        if getPlayerLevel(target) >= 1 and getPlayerLevel(target) <= 4999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "10000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp1 * lvl)

        elseif getPlayerLevel(target) >= 5000 and getPlayerLevel(target) <= 9999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "20000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp11 * lvl)
        
        elseif getPlayerLevel(target) >= 10000 and getPlayerLevel(target) <= 14999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "30000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp2 * lvl)
        
        elseif getPlayerLevel(target) >= 15000 and getPlayerLevel(target) <= 19999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "40000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp22 * lvl)
    
        elseif getPlayerLevel(target) >= 20000 and getPlayerLevel(target) <= 24999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "50000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp3 * lvl)

        elseif getPlayerLevel(target) >= 25000 and getPlayerLevel(target) <= 29999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "60000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp33 * lvl)

        elseif getPlayerLevel(target) >= 30000 and getPlayerLevel(target) <= 34999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "70000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp4 * lvl)

        elseif getPlayerLevel(target) >= 35000 and getPlayerLevel(target) <= 39999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "80000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp44 * lvl)

        elseif getPlayerLevel(target) >= 40000 and getPlayerLevel(target) <= 44999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "90000000", 215)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp5 * lvl)

        elseif getPlayerLevel(target) >= 45000 and getPlayerLevel(target) <= 49999 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "100000000", 210)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp55 * lvl)

        elseif getPlayerLevel(target) >= 50000 and getPlayerLevel(target) <= 90000 and getPlayerLevel(cid) >= 1 then
            doSendAnimatedText(getPlayerPosition(cid), "110000000", 210)
            doPlayerAddExperience(cid, getPlayerLevel(cid) * exp6 * lvl)
end
    end
    return true
end

 

Editado por gabriel28 (veja o histórico de edições)

Postado
  • Autor

@gabriel28


eu percebi uma coisa, tipo, ele funciona perfeitamente quando voce pega TARGET (clica no alvo com o botao direito)


ele SÓ aparece o error no distro quando mata um monstro ou player na magia.
exemplo: dou um exevo gran mas flam em varios cave rat, ai morre tudinho, aparece varios error na distro
exemplo2: dou um exevo gran mas flam em um player level 8, ai ele morre de HS e aparece novamente o error na distro

 

vc sabe resolver?

Editado por poko360 (veja o histórico de edições)

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