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

script that make you wont lose items when you die

Dramix

New Member
Joined
Jun 26, 2009
Messages
289
Reaction score
1
hello, i want to make, so that when you die, you wont lose any item, same with skulls :), rep++ for help!
 
This first one will prevent anyone from dropping loot.

LUA:
function onPrepareDeath(cid, deathList)
	doCreatureSetDropLoot(cid, false)
	return true
end

This second one will prevent loot from dropping if you have any of those skulls.

LUA:
local t = {
	SKULL_WHITE,
	SKULL_RED,
	SKULL_BLACK
}

function onPrepareDeath(cid, deathList)
	if isInArray(t, getCreatureSkullType(cid)) then
		doCreatureSetDropLoot(cid, false)
	end
	
	return true
end

J.Dre
 
Last edited:
This first one will prevent anyone from dropping loot.

LUA:
function onPrepareDeath(cid, deathList)
	doCreatureSetDropLoot(cid, false)
	return true
end

This second one will prevent loot from dropping if you have any of those skulls.

LUA:
local t = {
	SKULL_WHITE,
	SKULL_RED,
	SKULL_BLACK
}

function onPrepareDeath(cid, deathList)
	if isInArray(t, getCreatureSkullType(cid)) then
		doCreatureSetDropLoot(cid, false)
	end
	
	return true
end

J.Dre

where i edit this?
 
Here is all of the information.

data/creaturescripts/scripts/login.lua
LUA:
registerCreatureEvent(cid, "NoDrop")

data/creaturescripts/creaturescripts.xml
LUA:
<event type="preparedeath" name="NoDrop" event="script" value="no_drop.lua"/>

Make a new LUA file and put the script in it. Rename it "no_drop" and place it in the following area:

data/creaturescripts/scripts

J.Dre
 
Last edited:
This first one will prevent anyone from dropping loot.

LUA:
function onPrepareDeath(cid, deathList)
	doCreatureSetDropLoot(cid, false)
	return true
end

This second one will prevent loot from dropping if you have any of those skulls.

LUA:
local t = {
	SKULL_WHITE,
	SKULL_RED,
	SKULL_BLACK
}

function onPrepareDeath(cid, deathList)
	if isInArray(t, getCreatureSkullType(cid)) then
		doCreatureSetDropLoot(cid, false)
	end
	
	return true
end

J.Dre

ah, thanks for ^, but how to put in both of this?
 
First:
data/creaturescripts/scripts/allnodrop.lua
LUA:
function onPrepareDeath(cid, deathList)
	doCreatureSetDropLoot(cid, false)
	return true
end

Second:
data/creaturescripts/scripts/skullnodrop.lua
LUA:
local t = {
	SKULL_WHITE,
	SKULL_RED,
	SKULL_BLACK
}
 
function onPrepareDeath(cid, deathList)
	if isInArray(t, getCreatureSkullType(cid)) then
		doCreatureSetDropLoot(cid, false)
	end
 
	return true
end

data/creaturescripts/creaturescripts.xml
XML:
<event type="preparedeath" name="AllNoDrop" event="script" value="allnodrop.lua"/>
<event type="preparedeath" name="SkullNoDrop" event="script" value="skullnodrop.lua"/>


I think it should be right ;p
 
First:
data/creaturescripts/scripts/allnodrop.lua
LUA:
function onPrepareDeath(cid, deathList)
	doCreatureSetDropLoot(cid, false)
	return true
end

Second:
data/creaturescripts/scripts/skullnodrop.lua
LUA:
local t = {
	SKULL_WHITE,
	SKULL_RED,
	SKULL_BLACK
}
 
function onPrepareDeath(cid, deathList)
	if isInArray(t, getCreatureSkullType(cid)) then
		doCreatureSetDropLoot(cid, false)
	end
 
	return true
end

data/creaturescripts/creaturescripts.xml
XML:
<event type="preparedeath" name="AllNoDrop" event="script" value="allnodrop.lua"/>
<event type="preparedeath" name="SkullNoDrop" event="script" value="skullnodrop.lua"/>


I think it should be right ;p

ah thanks, but something i need add to login.lua?
 
LUA:
local corpse_ids = {
	[0] = 3065, -- female
	[1] = 3058  -- male
}
function onPrepareDeath(cid, deathList)
	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
	return true
end
in the creaturescript.xml add
XML:
	<event type="preparedeath" name="onPrepareDeath" event="script" value="prevent drop.lua"/>

There ya go! Rep++ me if i helped xD
 
LUA:
local corpse_ids = {
	[0] = 3065, -- female
	[1] = 3058  -- male
}
function onPrepareDeath(cid, deathList)
	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
	return true
end
in the creaturescript.xml add
XML:
	<event type="preparedeath" name="onPrepareDeath" event="script" value="prevent drop.lua"/>

There ya go! Rep++ me if i helped xD

Hm, that doesn't deserve reputation.
 
Back
Top