Editei seu script, e peguei um outro, pra caso vc preferir usar... Aí está o seu editado:
function onKill(cid, target)
--config----------------------------
local lvl = getPlayerLevel(cid) --players level
local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels
--end-------------------------------
if isPlayer(target) == TRUE then
if getPlayerIp(cid) ~= getPlayerIp(target) then
local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5
local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5
local newexp = nexp - exp
doPlayerAddExp(cid,newexp)
doPlayerAddItem(cid, 2160, 20)
doCreatureSetDropLoot(target, false)
doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198)
else
doPlayerAddExperience(cid, -50000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
end
addEvent(additem, 1000)
end
end
return TRUE
end
Em creaturescripts crie um arquivo chamado killbonus.lua dentro coloque isso:
local lvlMinGainHeart = 1 -- lvl minimo pra ganhar o coração.
local lvlMaxGainHeart = 2000 -- lvl maximo pra ganhar o coração.
local lvlGain = { -- se lvl maior que esses, ganham esses determinados itens.. Se não quiser é só colocar 99999 la e o player continuara ganhando bonus normal)
{lvl = 2000, itemid = 2160, quant = 2}, -- lvl, id do item, quantidade.
{lvl = 3000, itemid = 2160, quant = 5},
{lvl = 4000, itemid = 2160, quant = 10}
}
function onKill(cid, target, lastHitKiller)
if(isPlayer(target) and isPlayer(lastHitKiller)) then
if getPlayerLevel(cid) >= lvlMinGainHeart and getPlayerLevel(cid) <= lvlMaxGainHeart then
doPlayerSendTextMessage(cid, 22, "Parabens, voce matou o jogador "..getCreatureName(target).." e tirou seu coraçao")
function additem()
local aditi = doPlayerAddItem(lastHitKiller, 2160, 2)
doItemSetAttribute(aditi, "description", "Este foi retirado de "..getCreatureName(target).."")
end
addEvent(additem, 1000)
return true
end
for i=1, #lvlGain do
if i < #lvlGain then
if getPlayerLevel(cid) > lvlGain.lvl and getPlayerLevel(cid) <= lvlGain[i+1].lvl then
doPlayerAddItem(lastHitKiller, lvlGain.itemid, lvlGain.quant)
end
else
if getPlayerLevel(cid) > lvlGain.lvl then
doPlayerAddItem(lastHitKiller, lvlGain.itemid, lvlGain.quant)
end
end
end
end
return true
end
Configurei pra ganhar 2 crystal coins, caso queira aumentar é só editar ali o que está em negrito!
Em creaturescripts.xml:
<event type="kill" name="killbonus" event="script" value="killbonus.lua"/>






info
Grupo: Cavaleiro
Registrado: 02/11/08
Posts: 195
Reputação: +2
Gênero: Masculino
Char no Tibia: Addamuuss
bom, estou com outro problema.
Quando os players matam não recebe dinheiro de recompensa.
Recebe outras coisas, menos dinheiro.
eu quero que receba dinheiro, me ajuda?
Complementando, aqui está meu Onkill.lua
function onKill(cid, target) --config---------------------------- local lvl = getPlayerLevel(cid) --players level local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels --end------------------------------- if isPlayer(target) == TRUE then if getPlayerIp(cid) ~= getPlayerIp(target) then local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5 local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5 local newexp = nexp - exp doPlayerAddExp(cid,newexp) doPlayerAddMoney(cid, 20) doCreatureSetDropLoot(target, false) doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198) else doPlayerAddExperience(cid, -50000) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.") end end return TRUE end