• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent [1.X] Heart in Corpse when Player kills you

Marko999x

999x era
Premium User
Joined
Dec 14, 2017
Messages
2,755
Solutions
80
Reaction score
1,891
Location
Germany
Did not see any script for newer version xD
so feel free to use xD
it wont drop any heart if player dies by monster
how it looks like:

1628646186727.png

keep in mind to regist in xml and login lua hehe

Lua:
function onDeath(player, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if not killer:isPlayer() then
        return true
    end
    local heart = corpse:addItem(2353, 1)
    heart:setAttribute(ITEM_ATTRIBUTE_NAME, ''..player:getName().."'s Heart")
    heart:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, ''..killer:getName()..' ['..killer:getLevel()..'] has killed '..player:getName()..' ['..player:getLevel()..']')
    return true
end
 
U can change the id as you want :D
And nice to hear, saw that on many evo ots back in 2013 or something
 
Does the heart decay?
Post automatically merged:

gkQxAiesp5.gif
 
Last edited:
I dont think so
just remove the line in items.xml
<attribute key="decayTo" value="0" />
 
Did not see any script for newer version xD
so feel free to use xD
it wont drop any heart if player dies by monster
how it looks like:

View attachment 61094

keep in mind to regist in xml and login lua hehe

Lua:
function onDeath(player, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if not killer:isPlayer() then
        return true
    end
    local heart = corpse:addItem(2353, 1)
    heart:setAttribute(ITEM_ATTRIBUTE_NAME, ''..player:getName().."'s Heart")
    heart:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, ''..killer:getName()..' ['..killer:getLevel()..'] has killed '..player:getName()..' ['..player:getLevel()..']')
    return true
end
Hello, how to install this script ? :) there to put and what lines to put to login and registr ? folders ? please help :)
 
<event type="death" name="Heart" script="example.lua" />

player:registerEvent("Heart")
 
Back
Top