• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[CreatureEvent]Kill X Monster Remove Item

tetra20

DD
Joined
Jan 17, 2009
Messages
1,316
Solutions
4
Reaction score
327
Location
Egypt
I Am New To Scripting

First Go To CreatureScripts/Scripts Add a New Xml Folder Add This
Code:
function onDeath(cid, corpse, deathList)

local remove = {x=1003, y=1005, z=7}
local id = 1444
local remove1 = getTileItemById(remove, id)

if	doRemoveItem(remove1.uid, 1) then
	addEvent(doCreateItem, 20 * 1000, id, 1, {x=1003,y=1005,z=7})
	end
	end
then go to CreatureScripts/creaturescripts And Add This
Code:
<event type="death" name="killmonster" event="script" value="anything.lua"/>

then go to CreatureScripts/scripts/login

add this
Code:
registerCreatureEvent(cid,'KillMonster')

then go to monsters/YourMonster And Add This
Code:
 <script>
   <event name="killmonster"/>
	</script>

Just rep++ me if i helped
Thanks To StreamSide
 
Last edited:
also add a return true before the last end :) i guess the onDeath function will get bugged without the return true
 
i don't want to tell you i tested it and it worked so you don't Get Mad ^_^

- - - Updated - - -

Gn8 Stream Side ty for the advice Btw if you have any simple and good loops tutorial can you give me it because i really suck at loops

and another thing: i see people use Function OnLoseOnZombieArena or function on BlaBla what does it mean?
 
dont really get it what am i supposed to add in my monster/Elder Bug.xml?
should i delete everything inside it and just paste?
<script>
<event name="killmonster"/>
</script>
 
Back
Top