• 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!

Put item to corpse

pioncz

New Member
Joined
Dec 3, 2008
Messages
149
Reaction score
1
Hi,
If somebody die the killer will take heart with special discription, but i want to put this heart to corpse. So how can i make this ? This is script for giving special heart to killer :
Code:
  -- by zonet, watkins577 and Pioncz
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 read: "..getCreatureName(lastHitKiller).. " killed by "..getPlayerName(cid).." at "..getPlayerLevel(cid).." level."
}
    heart = doPlayerAddItem(mostDamageKiller, config.addItem)
	doSetItemSpecialDescription(heart, config.itemDesc)
end
    return TRUE
end
 
Lua:
  -- by zonet, watkins577 and Pioncz, fixed again 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 read: "..getPlayerName(cid).. " killed by "..getPlayerName(lastHitKiller).." at level "..getPlayerLevel(cid).."."
}
	local heart = doAddContainerItem(corpse.uid, config.addItem, 1)
	doSetItemSpecialDescription(heart, config.ItemDesc)
end
    return TRUE
end
 
Great! Thank guys. But my server debuging this 2 players who are attacking them selfs :/
I cant make more reps to You, but i will make is soon.
 
When two players die, then they have debug (error and kill client), and they must to login again. Maybe i have bad Distro.
 
Code:
The Forgotten Server, version 0.3.3 (Crying Damson)
[23/05/2009 08:59:41] A server developed by Elf, Talaturen, Lithium, Kiper, Kornholijo, Jonern & Nightmare.
[23/05/2009 08:59:41] Visit our forum for updates, support and resources: http://otland.net.
I'll check itemDesc and write.
 
My wrong (i did ItemDesc instead of itemDesc :p

Lua:
  -- by zonet, watkins577 and Pioncz, fixed again 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 read: "..getPlayerName(cid).. " killed by "..getPlayerName(lastHitKiller).." at level "..getPlayerLevel(cid).."."
}
	local heart = doAddContainerItem(corpse.uid, config.addItem, 1)
	doSetItemSpecialDescription(heart, config.itemDesc)
end
    return TRUE
end
 
I changed it and debugs are still. Next i will change the server and write new thread if bugs will still exists :p ty bro's for help
 
Back
Top