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

CreatureEvent Do not drop a specific item

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
Author: skydangerous
Script: Do not drop a specific item
Function: Do not drop a specific item
Tested: Dev 0.4, 3777 and 3884.

In creaturescript/scripts create forever.lua
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
	if (getPlayerSlotItem(cid,2).itemid == 2173) then
		doCreatureSetDropLoot(cid, false)  
	end
return true
end

Register in login.lua
Lua:
registerCreatureEvent(cid, "forever")

In creaturescript.xml add
XML:
<event type="preparedeath" name="forever" event="script" value="forever.lua"/>


How to edit​

You can change 2173 to id of your item.
Lua:
itemid == 2173

In 2 you can change the slot of item.
Lua:
getPlayerSlotItem(cid,2)

Slots IDs
Lua:
CONST_SLOT_HEAD = 1
CONST_SLOT_NECKLACE = 2
CONST_SLOT_BACKPACK = 3
CONST_SLOT_ARMOR = 4
CONST_SLOT_RIGHT = 5
CONST_SLOT_LEFT = 6
CONST_SLOT_LEGS = 7
CONST_SLOT_FEET = 8
CONST_SLOT_RING = 9
CONST_SLOT_AMMO = 10
 
Last edited:
Back
Top