# Glitchy HitTest Script

**URL:** <https://forum.kirupa.com/t/glitchy-hittest-script/280243>\
**Category:** Uncategorized\
**Created:** [January 24, 2009, 9:29pm UTC](https://forum.kirupa.com/t/glitchy-hittest-script/280243 "2009-01-24T21:29:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santa\_Clause](https://avatars.discourse-cdn.com/v4/letter/s/278dde/32.png) [@Santa\_Clause](https://forum.kirupa.com/u/Santa_Clause)\
**Post date:** [January 24, 2009, 9:29pm UTC](https://forum.kirupa.com/t/glitchy-hittest-script/280243/1 "2009-01-24T21:29:16Z")

</div>

Hey peoples,

I’m building a game and I keep having glitches when using 2 of these scripts in the same frame(Doesn’t matter which layer):

```auto
onEnterFrame = function () {
	if (survivor.hitTest(door) && coinsNeeded == 3) {
		gotoAndStop("room9");
	}
};

```

The second script I type keeps not working at all.  
Even when the hittest is different like door2, door3, and the GoTo.  
And yes if there’s 2 doors I change the instance name of the door as well, this glitch is purely Flash based.  
Could anyone explain this or help me out?
