hello, I had made a script that when you kill a demon you loot a key from it with actionID 6000. but it doesn't work, I dunno why??
I also added the even to the Demon
and to creaturescripts.xml
I don't know where is the problem ???!
Code:
function onDeath(cid, corpse, killer)
local key = 2089
if corpse == 2916 then
doPlayerSendTextMessage(killer, MESSAGE_EVENT_ADVANCE, "Mystic Key is found")
doAddContainerItem(uid, key, 1)
doSetItemActionId(key, 6000)
end
end
I also added the even to the Demon
Code:
<script>
<event name="MysticKey"/>
</script>
and to creaturescripts.xml
Code:
<event type="death" name="MysticKey" script="MYSkey.lua"/>
I don't know where is the problem ???!