# Duplicating power ups

**URL:** https://forum.kirupa.com/t/duplicating-power-ups/162507
**Category:** Uncategorized
**Created:** [September 13, 2005, 11:00pm UTC](https://forum.kirupa.com/t/duplicating-power-ups/162507 "2005-09-13T23:00:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![colombianking](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@colombianking](https://forum.kirupa.com/u/colombianking)
#### Post date: [September 13, 2005, 11:00pm UTC](https://forum.kirupa.com/t/duplicating-power-ups/162507/1 "2005-09-13T23:00:29Z")

</div>

im making a space fighting game vertical scroller  
how do i make its so that lets say you get the yellow power up then the green one comes then the red one at a time and in random places  
and if you miss it goes to the top again or waits and goes to the top  
hope im being clear

```auto

onClipEvent (load) {
	function rewet() {
		this._x = random(500);
		this._y = random(10);
		power = random(20);
	}
	rewet();
}
onClipEvent (enterFrame) {
	if (_root.health>=0 ) {
		this._visible = true;
		this._y += power;
		if (this._y>620) {
			rewet();
		}
	}
}
onClipEvent (enterFrame) {
	if (this.hitTest(_root.spaceship)) {
		_root.powerbar.nextFrame();
		removeMovieClip(this);
		p1 = true;
	}
}

```

i have that on the first power up

```auto
onClipEvent (load) {
	function rewet() {
		this._x = random(500);
		this._y = random(10);
		power = random(30);
	}
}
onClipEvent (enterFrame) {
	if (_root.health>=0 and (p1=true)) {
		this._visible = true;
		this._y += power;
		if (this._y>620) {
			rewet();
		}
	}
}
onClipEvent (enterFrame) {
	if (this.hitTest(_root.spaceship)) {
		_root.powerbar.nextFrame();
removeMovieClip(this);
		p2 = true;
	}
}
onClipEvent (enterFrame) {
	if (p1=true) {
		this.rewet();
	}
}

```

this is what i have on the second but it doesnt work help
