Ta aew
1 abra o login.lua e add isso antes do ultimo Return true
registerCreatureEvent(cid, "Recompensa")
Agora feche e salve e va no creaturescripts.xml e add isso
<event type="death" name="Recompensa" script="recompensa.lua"/>
Feito isso va no scripts e crie recompensa.lua e add isso
config = {
reward = 200 --define o quanto o jogador ganhará
}
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
if(isPlayer(lastHitKiller) == TRUE) then
doPlayerAddMoney(lastHitKiller, config.reward)
doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "Voc\ê matou " .. getCreatureName(cid) .. " e recebeu " .. config.reward .. " GPs.")
end
return TRUE
end
Creditos:OneShot80%
TheDevilZ:20% por trazer aki :smile_positivo: