Ir para conteúdo

Featured Replies

Resolvido por Pedro.

Ir para solução
Postado
  • Solução

Cara, eu não tenho conhecimento em lua, eu ajudo no que posso, retorna o valor do deathlostpercent na config lua

e tenta esse script aqui.

 

creaturescript/script

levelprotection.lua

function onDeath(cid, corpse, deathList)
local config = {
onlypremium = true, -- se precisa ser premium para não perder nada
exp = true, -- se ao morrer o jogador irá perder exp
skills = false, -- se ao morrer vai perder skills
magic = false, -- se vai perder magic level
loot = false, -- se ao morrer o jogador irá perder o loot
level = 999 -- 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

 

<event type="death" name="ProtectLevel" event="script" value="levelprotection.lua"/>
 
registerCreatureEvent(cid, "ProtectLevel")

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

Postado
  • Autor
1 hora atrás, Jobs disse:

Cara, eu não tenho conhecimento em lua, eu ajudo no que posso, retorna o valor do deathlostpercent na config lua

e tenta esse script aqui.

 

creaturescript/script

levelprotection.lua


unction onDeath(cid, corpse, deathList)
local config = {
onlypremium = true, -- se precisa ser premium para não perder nada
exp = true, -- se ao morrer o jogador irá perder exp
skills = false, -- se ao morrer vai perder skills
magic = false, -- se vai perder magic level
loot = false, -- se ao morrer o jogador irá perder o loot
level = 999 -- 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

 


<event type="death" name="ProtectLevel" event="script" value="levelprotection.lua"/>
 

registerCreatureEvent(cid, "ProtectLevel")

 

Botei o F NO Começo PEGOU valeu ai fera.

image.png

Editado por mikaelkelvin (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.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo