3 and 4 are not printed since OnSummonEnd is never triggered.Okey I tried your function this way. And when I start on gossip and kill summoned Npc's. I never get message test 2,3,4. Where did I miss something ?
Thank you for you're help.
Also all of these prints use creature:SendBroadcastMessage and SendBroadcastMessage is a player method so you should be getting a bunch of errors from the script.
If you dont have access to the player, easy way to do debug prints that print ingame is using SendWorldMessage("Test 2")
I tested the script I posted earlier which works fine. (I used NPC entries 36, 40 and 38)
Determining whether to use the despawn or death event or both somehow is an issue there, but you can decide the details like that.