i need one creature script !!!
if player die for monster and is <= lvl 20 then
not lose exp and loot
im using tfs 0.4 rev3777
I tried to use this, but did not work!
not show errors in console but not work Oo
if player die for monster and is <= lvl 20 then
not lose exp and loot
im using tfs 0.4 rev3777
I tried to use this, but did not work!
Code:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
-- configuração
local config = {
exp = false, -- se ao morrer o jogador irá perder exp
loot = false, -- se ao morrer o jogador irá perder o loot
level = 20 -- até que level irá proteger o player
}
if isPlayer(cid) and getPlayerLevel(cid) <= config.level then
elseif config.loot == false then
doCreatureSetDropLoot(cid, false)
elseif config.exp == false then
doPlayerSetLossPercent(cid, experience, 0)
end
return TRUE
end
Code:
<event type="preparedeath" name="ProtectLevel" event="script" value="levelprotection.lua"/>
Code:
registerCreatureEvent(cid, "ProtectLevel")
not show errors in console but not work Oo