# True/ False statment problem

**URL:** <https://forum.kirupa.com/t/true-false-statment-problem/215221>\
**Category:** Uncategorized\
**Created:** [February 5, 2007, 4:06pm UTC](https://forum.kirupa.com/t/true-false-statment-problem/215221 "2007-02-05T16:06:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jose3760](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jose3760/32/2887_2.png) [@jose3760](https://forum.kirupa.com/u/jose3760)\
**Post date:** [February 5, 2007, 4:06pm UTC](https://forum.kirupa.com/t/true-false-statment-problem/215221/1 "2007-02-05T16:06:37Z")

</div>

I have it where i have a little ball, and i push crates along. Im trying ot make it so that when then then crate goes into water, i cant push it anymore.

here is the code i have on the ball:

[FONT=Comic Sans MS][SIZE=3]// This is the true/salse statement for the crate[/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3][COLOR=blue]onClipEvent(load){  
crate = true;  
}[/COLOR][/SIZE][/FONT]

[FONT=Comic Sans MS][SIZE=3]//this moves our character (named ball)[/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3][COLOR=blue]onClipEvent (enterFrame) {  
if (Key.isDown(Key.UP)) {  
this.\_y -= 21.15;[/COLOR][/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3]//this is to check if my crate is in the water or not[/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3]//if its not, then i can push it[/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3]//if it is in the water, then i shouldnt be able to push it  
[COLOR=blue]if (crate == true){  
if (this.hitTest(\_root.box)) {  
\_root.box.\_y -= 21.15;  
}[/COLOR]  
// this is what it does if the crate(box) is hitting the water  
[COLOR=blue]} else{  
\_root.crate.gotoAndStop(2);  
}  
}  
}[/COLOR][/SIZE][/FONT]

[FONT=Comic Sans MS][SIZE=3]the rest is all the same, just changed for the different directions that your character will move, so i took it out[/SIZE][/FONT]

[FONT=Comic Sans MS][SIZE=3]ok, now the code i have on the floor (not the water)[/SIZE][/FONT]

[FONT=Comic Sans MS][SIZE=3][COLOR=blue]onClipEvent(enterFrame){  
if(\_root.box.hitTest(this)){[/COLOR][/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3][COLOR=blue][COLOR=black]//this keeps the box normal  
[/COLOR]\_root.box.gotoAndStop(1);  
} else[/COLOR][/SIZE][/FONT]  
[FONT=Comic Sans MS][SIZE=3]// if the box isnt hitting the floor, go to the box’s second frame, and make create = false  
[COLOR=blue]\_root.box.gotoAndStop(2);  
crate == false;  
}[/COLOR][/SIZE]  
[/FONT]  
make sense?  
if theres something u dont understand, or left out, just ask:s:
