The example looks like smaug to me, so I'll give it a try. Since you're not on smaug it may not work though.
When you're scripting a mob the game considers it a player character, and therefore you cannot kill it, you must "murder".
If it is like smaug, replace kill with mpkill $n.
If this doesn't work, I don't have any idea. (Never tried anything other than smaug.)
|