Pacman type thing

ok, so i was playing around trying to make a type of paceman script until i encountered an error. anyone want to help me?

script in level: i want it so that when someone has touches all of the blocks they get warped to 10 10. it just wont warp until you re-enter the level.

if (created) { timout=0.05; } if (timeout && hasweapon(-block1) && hasweapon(-block2) && hasweapon(-block3) && hasweapon(-block4)) { playerx=10; playery=10; }

script for each block (the toweapons -blockx;) changes for the blocks. oh yea, and i have the weapons destroy themselfs after you get all the blocks.

if (playertouchsme) { hide; toweapons -block1; } if (hasweapon(-block1) && hasweapon(-block2) && hasweapon(-block3) && hasweapon(-block4)) { destroy; }

i just need some help on figureing out why it wont warp until you re-enter the level.

Because, although you have if(timeout){ }, you don’t have something within it, to call another timeout. Ie: you’re missing timeout = 0.05;

so something like this:

if (timeout && hasweapon(-block1) && hasweapon(-block2) && hasweapon(-block3) && hasweapon(-block4)) { timeout=0.05; playerx=10; playery=10; }

or something like this:

if (created) { timout=0.05; } if (hasweapon(-block1) && hasweapon(-block2) && hasweapon(-block3) && hasweapon(-block4)) { playerx=10; playery=10; }

Follow through with the logic.

if (created) {timout=0.05;} //I call “if(timeout)” in 0.05 seconds.
if(timeout && crap) { //I start when “timeout” is called.
timeout = 0.05; // Timeout was called, I think I’ll call it again in 0.05 seconds.
}

so you need the timeout 2 times? that wont work for me. and niether will any of the other things i posted.

if(created) works only once; when you enter the level. Therefore, it will only timeout once.

The goal is to start a timeout when the NPC is created, and then when the timeout is called, create another timeout, thus creating a loop and making the NPC run constantly(over and over). Loops are the key to making an NPC constantly process information and react. An NPC with a timeout loop and x += .5 will make the NPC constantly move to the right side of the screen.

edit: because I’m bored:

I understood the concept until the diagram, that part counfused me.

That’s what all of you are saying and it won’t work.

Hi, was around so i thought i could drop by.
…Maybe you should use a real command in if(created).

lol I said “timout”.

if(playerenters || timeout) {
setplayerprop #c,#K(int(random(40,80)))#K(int(random(40,80)))!!;
timeout = 0.05;
}

lol, O_o

WOAH! THAT LINE IS INTENSE!

I had #k, instead of #K, try 'er now :[

Nice fuck up.

I’m sure your parents said the same thing. LOL

ROFL!

Oh, wow. That, sir, was the burn of the century. I’m sure of it. I’m in tears from that.