• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Heart of death player.

@Zonet
doPlayerAddItem(killer, config.addItem)
Where is this killer in the function onDeath?
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
There is no Killer.
So in that case it should be:
doPlayerAddItem(lastHitKiller, config.addItem)
or
doPlayerAddItem(mostDamageKiller, config.addItem)

@pioncz
Try it.
LUA:
function onKill(cid, target)
if(isPlayer(target) == TRUE) and isPlayer(cid) == TRUE then   
      doSetItemSpecialDescription(doPlayerAddItem(cid,1685,1), "This is the heart of "..getPlayerName(target).." ["..getPlayerLevel(target).."]. who was killed by ".. getPlayerName(cid) .." ["..getPlayerLevel(cid).."].")
   end
	return TRUE
end
 
Last edited:
Elvang coz burning heart is something like rare item. Its realy hard to get one. Heart pillow You can buy in shop and if my server will have pk's than burning heart will be still good item.
Kekox dont work your script :(
 
Modified Azis script should work :)

LUA:
-- script by Azi, fixed by Zonet
local config = {
    addItem = 1685, -- heart id
    itemDesc = {
        "You received this when you killed",
        -- Name
        "when", 
        -- Sex
        "was level"
        -- Level
}
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)    
    if isPlayer(mostDamageKiller) == TRUE then
    if getPlayerSex(cid) == 0 then
        "she"
    else
        "he"
    end
    doPlayerAddItem(mostDamageKiller, config.addItem)
    doSetItemSpecialDescription(1685, config.itemDesc[1].." "..getPlayerName(cid).." "..config.itemDesc[2].." "..sex.." "..config.itemDesc[3].." "..getPlayerLevel(cid)..".")

    return TRUE
end
 
Last edited:
Zonet 1 error in Your script:
Code:
[21/05/2009 19:03:16] Lua Script Error: [CreatureScript Interface] 
[21/05/2009 19:03:16] data/creaturescripts/scripts/2.lua:onDeath

[21/05/2009 19:03:16] luaDoSetItemSpecialDescription(). Item not found
 
Try this

LUA:
  -- script by Azi, fixed by Zonet, fixed again by Watkins577
local config = {
    addItem = 1685, -- heart id
    itemDesc = {
        "You received this when you killed",
        -- Name
        "when",
        -- Sex
        "was level"
        -- Level
}
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)    
    if isPlayer(mostDamageKiller) == TRUE then
    if getPlayerSex(cid) == 0 then
        "she"
    else
        "he"
    end
    heart = doPlayerAddItem(mostDamageKiller, config.addItem)
    doSetItemSpecialDescription(heart, config.itemDesc[1].." "..getPlayerName(cid).." "..config.itemDesc[2].." "..sex.." "..config.itemDesc[3].." "..getPlayerLevel(cid)..".")

    return TRUE
end
 
@up
Epic FAIL
because
LUA:
    doSetItemSpecialDescription(heart,
where is the variable for it?

second problem with your is,
LUA:
 if getPlayerSex(cid) == 0 then
"she"
else
"he" --i did something worng ;) 
-- it must be

if getPlayerSex(cid) == 0 then
sex = "she"
else
sex = "he"
end
;)

take this
LUA:
  -- by zonet
local config = {
    addItem = 1685,
    itemDesc = "You received this when you killed "..getPlayerName(cid).." when "..sex.." was level "..getPlayerLevel(cid).."."
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)    
    if isPlayer(lastHitKiller) == TRUE then
    if getPlayerSex(cid) == 0 then
   sex = "she"
    else
     sex = "he"
    end
    itemAdd = doPlayerAddItem(lastHitKiller, config.addItem)
    doSetItemSpecialDescription(itemAdd, config.itemDesc)
    return TRUE
end
 
Last edited:
@up
I did not fail because I declared heart in the line before.

Change:
LUA:
doPlayerAddItem(mostDamageKiller, config.addItem)
doSetItemSpecialDescription(config.addItem, config.itemDesc)

To:
LUA:
heart = doPlayerAddItem(mostDamageKiller, config.addItem)
doSetItemSpecialDescription(heart, config.itemDesc)
and it should work fine.
 
@up
Yea, i didn't see it :) but anyway it wont work because u got wrong in your description.

I'm sure that this one will work 100%

LUA:
   -- by zonet
local config = {
    addItem = 1685,
    itemDesc = "You received this when you killed "..getPlayerName(cid).." when "..sex.." was level "..getPlayerLevel(cid).."."
}

function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)    
    if isPlayer(lastHitKiller) == TRUE then
    if getPlayerSex(cid) == 0 then
   sex = "she"
    else
     sex = "he"
    end
    itemAdd = doPlayerAddItem(lastHitKiller, config.addItem)
    doSetItemSpecialDescription(itemAdd, config.itemDesc)
	end
    return TRUE
end
 
I edited much and it work!!!!
Thanks !!!! Rep's going to You!!!!
Code:
  -- by zonet
local sex = ""
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)  
  
    if isPlayer(mostDamageKiller) == TRUE then
    if getPlayerSex(cid) == 0 then
   sex = "she"
    else
     sex = "he"
    end 

local config = {
    addItem = 1685,
    itemDesc = "You received this when you killed "..getPlayerName(cid).." when "..sex.." was level "..getPlayerLevel(cid).."."
}
    heart = doPlayerAddItem(mostDamageKiller, config.addItem)
	doSetItemSpecialDescription(heart, "configitemDesc")
end
    return TRUE
end
 
Dont work :D
But i gove reps.
Now i will make new thread coz nobody will read from first post everything.
In new thread i will ask for put this fu heart to corpse ; D
 
@up maybe your using the wrong distro? Or maybe your just retarded.

your mom is retarded, if you don't know Lua then shut the fuck up im just trying to help -.-

LUA:
local config = {
    addItem = 1685,
    itemDesc = "You received this when you killed "..getPlayerName(cid).." when "..sex.." was level "..getPlayerLevel(cid).."." -- cid is nil
}

cid is nil there -.- now shut up
 
Back
Top