KO
pedido

Script lvl protection (underwar)

Por kolosso, 14 de set. de 2015 em Scripts

7
2.1k
kolossoK
15 de setembro de 2015 às 22:28

Boa noite, to atrás desse script faz um bom tempo e não consigo achar, to querendo um script de lvl protection igual ao do underwar, ( player até lvl X não perder item se morrer pra pk, se morrer pra monstro ele dropa loot, se ele tiver no lvl da protection e pega pk dropa loot ao morrer, caso não esteja de aol)

Pvp livre...


@up

BrunoB
16 de setembro de 2015 às 10:38

Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:

 

<event type="death" name="LevelProtect" event="script" value="levelprotect.lua" />

 

Agora em data/creaturescripts/scripts crie o arquivo levelprotect.lua com o seguinte conteúdo:

 

local level = 50 -- até que level o script irá proteger o player
 
function onDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) and isPlayer(mostDamageKiller) and getCreatureSkullType(cid) == SKULL_NONE then
            if getPlayerLevel(cid) <= level the
                doPlayerSetLossPercent(cid, 0, 0)
                doCreatureSetDropLoot(cid, false)
                return true
            end
    end
    return true
end

 

Ainda em scripts, abra o arquivo login.lua e registre o evento:

 

registerCreatureEvent(cid, "LevelProtect")
kolossoK
19 de setembro de 2015 às 09:46

Deu esse erro
post-358727-0-29538900-1442666773_thumb.png

LumusL
19 de setembro de 2015 às 10:09

Use este:

local level = 50 -- até que level o script irá proteger o player
 
function onDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) and isPlayer(mostDamageKiller) and getCreatureSkullType(cid) == SKULL_NONE then
            if getPlayerLevel(cid) <= level then
                doPlayerSetLossPercent(cid, 0, 0)
                doCreatureSetDropLoot(cid, false)
                return true
            end
    end
    return true
end
1 mês depois...
kolossoK
04 de outubro de 2015 às 10:05

 

Use este:

local level = 50 -- até que level o script irá proteger o player
 
function onDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) and isPlayer(mostDamageKiller) and getCreatureSkullType(cid) == SKULL_NONE then
            if getPlayerLevel(cid) <= level then
                doPlayerSetLossPercent(cid, 0, 0)
                doCreatureSetDropLoot(cid, false)
                return true
            end
    end
    return true
end

Desculpe a demora, (tava sem tempo)

 

Acabei de testar esse script e não funcionou, ele não da nenhum erro, mas players abaixo do lvl 50 quando morrem pra Mobs do mapa perdem loot e tbm perdem quando são mortos por outros players, mesmo não estando pk.

uso Tfs 0.4

Editado Outubro 4 por kolosso

2 semanas depois...
kolossoK
11 de outubro de 2015 às 20:58

@up

kolossoK
15 de outubro de 2015 às 10:52

@up