void main() { object oPC = GetEnteringObject(); string sAmbush = "An Ambush!"; effect eEffect = EffectVisualEffect(VFX_IMP_DUST_EXPLOSION); object oCloset = GetNearestObjectByTag("armoire_rh"); // change this to your custom placeable tag int nVoiceChatID = VOICE_CHAT_BATTLECRY3; int nObjectType = OBJECT_TYPE_CREATURE; string sTemplate = "goblin_rh"; // change this to your creature tag location oLoc = GetLocation(oCloset); if (!GetIsPC(oPC)) return; if (GetObjectType(oCloset) == OBJECT_TYPE_PLACEABLE) { FloatingTextStringOnCreature(sAmbush, oPC, TRUE); if (GetHitDice(oPC) >= 15) // change these values as appropriate { ApplyEffectToObject (DURATION_TYPE_INSTANT, eEffect, oCloset); CreateObject(nObjectType,sTemplate,oLoc,TRUE); CreateObject(nObjectType,sTemplate,oLoc,TRUE); } else { ApplyEffectToObject (DURATION_TYPE_INSTANT, eEffect, oCloset); CreateObject(nObjectType,sTemplate,oLoc,TRUE); } PlayVoiceChat(nVoiceChatID,GetNearestObjectByTag("goblin_rh",OBJECT_SELF)); // change this to your creature tag AssignCommand(GetNearestObjectByTag("goblin_rh"), SetFacingPoint(GetPosition(oPC))); // change this to your creature tag } }