Hi
how to use the .lua code to be assigned to monsters.
I try this way:
in xml, e.g. rat
in data\scripts\creaturescripts I added
rathink.lua
but this is don't work
how to use the .lua code to be assigned to monsters.
I try this way:
in xml, e.g. rat
Lua:
<scripts>
<event name="RatThink"/>
</scripts>
in data\scripts\creaturescripts I added
rathink.lua
Code:
local creatureevent = CreatureEvent("RatThink")
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
creature:say("TEST", TALKTYPE_MONSTER_SAY)
return true
end
creatureevent:register()
but this is don't work