# Triggering enemy via certain score?

**URL:** <https://forum.kirupa.com/t/triggering-enemy-via-certain-score/145213>\
**Category:** Uncategorized\
**Created:** [April 20, 2005, 8:33pm UTC](https://forum.kirupa.com/t/triggering-enemy-via-certain-score/145213 "2005-04-20T20:33:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nox](https://avatars.discourse-cdn.com/v4/letter/n/b4bc9f/32.png) [@Nox](https://forum.kirupa.com/u/Nox)\
**Post date:** [April 20, 2005, 8:33pm UTC](https://forum.kirupa.com/t/triggering-enemy-via-certain-score/145213/1 "2005-04-20T20:33:21Z")

</div>

How do you cue an enemy based on a certain score? Say… if you kill 20 zombies, a boss would be triggered? There are NO BUTTONS in my game, it’s all run on MCs and actionscript.

On the Scene 1: First frame is preloader for the entire game. Second and third frame is code, the hero, bullet, and enemy1 (worth one point each). Fourth frame is hero, bullet, and boss1. You kill 20 enemies in frame 3, then you go to frame 4 for the boss.

I think the code would be something like  
if (\_root.score=20){  
gotoAndStop(“Scene 1”, 4)  
}  
but it doesn’t seem to work no matter where I place it.  
Where would I put the code? Is it right? Otherwise I got them starting at like x=8000 and the game lags.
