Testando Ja editor o Topico se resultar e resolver o problema ganhara meu Rep++
Player morre e é teleportado para o templo
Por jackfan, 12 de fev. de 2013 em Scripts
info
Grupo: Cavaleiro
Registrado: 19/09/07
Posts: 196
Reputação: +42
Char no Tibia: Programadorfp

function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
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 = 300 -- 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, false) end
if config.skills == false then doPlayerSetLossPercent(cid, false) end
return TRUE end return TRUE end
Pronto este está funcionando 100% testei agora!
info
Grupo: Cavaleiro
Registrado: 20/09/12
Posts: 153
Reputação: +31

Só uma duvida:
É para criar o arquivo? levelprotection.lua
Obrigado cara ganhou meu Rep+++ nao fecha o topico ainda vamos testar ja editor e falo se fecha ou se o problema nao foi resolvido
info
Grupo: Cavaleiro
Registrado: 19/09/07
Posts: 196
Reputação: +42
Char no Tibia: Programadorfp

Só uma duvida:
É para criar o arquivo? levelprotection.lua
É sim, em Creaturescripts\scripts.
cara funciono ganhou meu rep++ e do daniel ajudou bastante vlw
info
Grupo: Cavaleiro
Registrado: 20/09/12
Posts: 153
Reputação: +31

Só tem dois erros acontecendo quando um player morre
[Error - CreatureScript Interface] data/creaturescripts/levelprotetion.lua onDeath Description: <luaDoPlayerSetLossPercent> Player not found
pode ajudar?
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

Duvida Sanada, Topico Movido!
info
Grupo: Cavaleiro
Registrado: 20/09/12
Posts: 153
Reputação: +31

Duvida Sanada, Topico Movido!
Sanada não ainda tem um erro pode parar!
Deixa resolver tudo ![]()
Edit: resolvido!
Só deixei o script assim:
function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
loot = false, -- se ao morrer o jogador irá perder o loot
level = 1000 -- 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
return TRUE end return TRUE end
Editado Fevereiro 12 por DanielBadhu



info
Grupo: Cavaleiro
Registrado: 19/09/07
Posts: 196
Reputação: +42
Char no Tibia: Programadorfp
Para seu personagem não perder skills, level, loot etc...
Coloque em Creturescripts/scripts/levelprotection.lua
function onDeath(cid, corpse, deathList)
local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
exp = false, -- 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 = 70 -- 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
Coloque em Creturescripts/scripts/login.lua
registerCreatureEvent(cid, "ProtectLevel")
e em Creaturescripts.xml coloque:
<event type="death" name="ProtectLevel" event="script" value="levelprotection.lua"/>
Espero ter ajudado
--- EDITEI UM ERRO QUE TINHA --
JACKFAN COPIE E COLE NOVAMENTE O SCRIPT EU ERREI EM UMA PARADA
Editado Fevereiro 12 por murilo103