FA
pedido

[Pedido] Modificações nesse Script

Por Farathor, 10 de mar. de 2016 em Scripts

resolvido
script
6
1.1k
FarathorF
10 de março de 2016 às 20:53

Esse script, é um script que protege jogador com level menor que 150 para que não percam loot, mas eu queria que ele fizesse isso, mas tem um porém, jogador que tivesse com pk, red ou black irão perder loot, conseguiram entender?

 

function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
exp = true, -- se ao morrer o jogador irá perder exp
skills = true, -- se ao morrer vai perder skills
magic = true, -- se vai perder magic level
loot = false, -- se ao morrer o jogador irá perder o loot
level = 150 -- até que level irá proteger o player
}
if isPlayer(cid) and getPlayerLevel(cid) <= config.level then
if config.onlypremium == true and not isPremium(cid) then return TRUE end
if config.loot == false then doCreatureSetDropLoot(cid, false) end
if config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end
if config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) end
if config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end
return TRUE end return TRUE end
DanihcvD
10 de março de 2016 às 22:18
Melhor resposta

Tenta ae:

function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
exp = true, -- se ao morrer o jogador irá perder exp
skills = true, -- se ao morrer vai perder skills
magic = true, -- se vai perder magic level
loot = false, -- se ao morrer o jogador irá perder o loot
level = 150 -- até que level irá proteger o player
}
if isPlayer(cid) and (getPlayerLevel(cid) <= config.level) and (not isPlayerPzLocked(cid)) then
if config.onlypremium == true and not isPremium(cid) then return TRUE end
if config.loot == false then doCreatureSetDropLoot(cid, false) end
if config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end
if config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) end
if config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end
return TRUE end return TRUE end
FarathorF
10 de março de 2016 às 22:27

você colocou para ele não estar com pz lock certo? mas eu queria que no caso, ele só perdesse items se tivesse com skull


mas obrigado, seu script fez eu pensar e eu consegui arrumar, obrigado, reslvido

JanmixJ
10 de março de 2016 às 23:32
function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
exp = true, -- se ao morrer o jogador irá perder exp
skills = true, -- se ao morrer vai perder skills
magic = true, -- se vai perder magic level
loot = false, -- se ao morrer o jogador irá perder o loot
level = 150 -- até que level irá proteger o player
}
if isPlayer(cid) and (getPlayerLevel(cid) <= config.level) and (getPlayerSkullType(cid) > 2) then 
if config.onlypremium == true and not isPremium(cid) then return TRUE end
if config.loot == false then doCreatureSetDropLoot(cid, false) end
if config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end
if config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) end
if config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end
return TRUE end return TRUE end

tenta ae

obs. não testei, só mudei a função do script que o Danihcv colocou.

DanihcvD
11 de março de 2016 às 00:06

@@Farathor, saquei. Se possível, poste o resultado final que funcionou para vc, pra que eu possa mover o tópico para resolvidos e para se caso alguem no futuro estiver a procura deste conteúdo, encontrar e tb resolver.

*se bem que eu acho que o do Janmix deve dar conta do trabalho. ^^

3 semanas depois...
DanihcvD
26 de março de 2016 às 16:15

Tópico movido para dúvidas / pedidos resolvidos.