# Help needed - hit test door based on coins collected

**URL:** <https://forum.kirupa.com/t/help-needed-hit-test-door-based-on-coins-collected/309018>\
**Category:** Uncategorized\
**Created:** [May 5, 2010, 4:14am UTC](https://forum.kirupa.com/t/help-needed-hit-test-door-based-on-coins-collected/309018 "2010-05-05T04:14:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![R1KM4N](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@R1KM4N](https://forum.kirupa.com/u/R1KM4N)\
**Post date:** [May 5, 2010, 4:14am UTC](https://forum.kirupa.com/t/help-needed-hit-test-door-based-on-coins-collected/309018/1 "2010-05-05T04:14:27Z")

</div>

Hi there guys, I’m fairly new to flash. I’m making a game for my end of year project. It is a simple platformer, one that I have had several problems with, but it seems to work fine. Anyhow, one of the aspects involves you collecting a series of coins. In one of my rooms, I want there to be a hit test so if they player connects with the item and has 5 or more coins, then they go to and play a new frame.

I have seen how to do it just as go to and play, but I need it as part of a hit test. The code I’m using doesn’t want to work, keep getting syntax error. Having a tough time finding help online too. Any help would be majorly appreciated.

The code I am using is as follows -

if ( score == 5 ) {  
\_root.doormetal.hitTest(\_x, \_y, true) {  
\_root.save\_y\_speed = yspeed;  
\_root.save\_y\_position = \_y;  
\_root.throughdoor = 1;  
\_root.gotoAndPlay(“screen47edit”);

```
}
}

```

It is always the second line that seems to bring up the syntax error, but I have no clue why :S
