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

I need remove skulls to logout and dead dont loss items

Morrison

Intermediate OT User
Joined
Mar 15, 2009
Messages
283
Solutions
3
Reaction score
123
Location
Exive me
GitHub
none
Hi this script no remove skull to dead and players loss items in red and black skulls
what is the solution?


PHP:
local skulls = {
SKULL_NONE,
SKULL_YELLOW,
SKULL_GREEN,
SKULL_WHITE,
SKULL_RED,
SKULL_BLACK,
SKULL_BLACK
}

function onLogout(cid)
    for i = 1, table.maxn(skulls) do
       doPlayerSetSkullEnd(cid, 0, skulls[i])
    end
    return true
end
 
In the creturescript make file calle forever aol.lua
LUA:
local corpse_ids = {
	[0] = 3065, -- female
	[1] = 3058  -- male
}
function onPrepareDeath(cid, deathList)
	if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
               doPlayerSetSkullEnd(cid, 0, getPlayerSkullType(cid))
		doCreatureSetDropLoot(cid, false)
               
		doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
		local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""		
		for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
			killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
		end
		doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
	end
	return true
end

then in the creature script.xml paste this line
Code:
<event type="preparedeath" name="onPrepareDeath" event="script" value="forever aol.lua"/>


then go to creaturescript-->scripts-->login.lua and paste this line in the end of the script over "return true"
LUA:
registerCreatureEvent(cid, "onPrepareDeath")
 
Last edited:
Back
Top