Blade33711
Member
How to get the name of a monster from corpse and save to a variable?
TFS 0.4
TFS 0.4
it depends on how you're planning on using it later onAny suggestion how to do it?
I really don't know.
I would later to know the position of a dead monster to catch him.
local function changeCorpseDescription(pos, name)
doSetItemSpecialDescription(getThingFromPos(pos).uid, "The soul of a ".. name .." is still here.")
end
function onDeath(cid)
if isMonster(cid) then
addEvent(changeCorpseDescription, 5, getCreaturePosition(cid), getCreatureName(cid))
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local description = getItemSpecialDescription(itemEx.uid)
if description then
local monster = description:match("The soul of a (.*) is still here.")
if monster then
doItemSetSpecialDescription(doPlayerAddItem(cid, 2345).uid, "This paper holds the soul of a ".. monster ..".")
doRemoveItem(item.uid, 1)
end
end
return true
end