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

C++ onDeath all monsters

Blade33711

Member
Joined
Aug 6, 2012
Messages
133
Solutions
1
Reaction score
5
Location
Poland
Hi! I'm using tfs 0.4 and I have added: Feature - [CreatureEvent] Regestire all monster and players in creatureevent.xml
I have a problem. I'm using this script but it didn't work.. :(
XML:
<event type="death" name="monsterDeath" registerTo ="monster" event="script" value="script.lua"/>
Lua:
function onDeath(cid, corpse, deathlist)
    if isMonster(cid) then
        doAddContainerItem(corpse.uid, 2123, 1)
    end
return true
end

Help me please. How make this work for every monster?
 
Im not sure how exactly works on 0.4, but usually you need to register the event on the actual monster. To do that, you should find some onSpawn() function and apply it to every monster just after spawn on the map. It should be placed in events.
 
or you can use Replace Text by Ecobyte and search for </monster> and make it like that :
XML:
<script>
<event name="name_of_event_in_creaturescripts.xml"/>
</script>
  </monster>
bit easier then C++ :p
 
Might be a stupid questions, but:
Is your filename actually 'script.lua'?
Did you recompile after editing sources?
 
Back
Top