# Random battle... part2

**URL:** <https://forum.kirupa.com/t/random-battle-part2/174684>\
**Category:** Uncategorized\
**Created:** [January 8, 2006, 3:44am UTC](https://forum.kirupa.com/t/random-battle-part2/174684 "2006-01-08T03:44:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpxnamja](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kpxnamja](https://forum.kirupa.com/u/kpxnamja)\
**Post date:** [January 8, 2006, 3:44am UTC](https://forum.kirupa.com/t/random-battle-part2/174684/1 "2006-01-08T03:44:48Z")

</div>

Hi there, I originally began on a project based on a turn based engine, however, it has evolved into something much more different…

I have come back to the random battle selection… Here’s my question.

When I had first started, I set an AS to trigger a random(99) as the user pressed a key(movemenr key up, down, etc.) but that was inefficient as a person holding down the key would be more likely to enter a battle, than the other who taps the movement button.

So I decided to do a manual tile based random battle… Here is where I come to a dead end. How do I make the random(99) only trigger itself once,when the hero.mc goes over it and allow itself to retrigger itself once the hero.mc leaves it?

GOAL:  
create the most efficient random battle generator.  
(after moving a few, the gamer is sent to the battle scene).
