Post Mon May 08, 2006 4:47 pm

GML Help - only for people good at gml

All right I just can't figure this out:
//MegaBuster Script- Mega man Weapon - Mega Buster
if sprite_index = mm_stanceright or mm_runright or mm_jumpright or mm_shootrunright or
mm_shootstanceright or mm_shootjumpright then
{ instance_create(x,y,mega_bulletright)

{if sprite_index = mm_stanceleft or mm_runleft or mm_jumpleft or mm_shootrunleft or
mm_shootstanceleft or mm_shootjumpleft then
{ instance_create(x,y,mega_bulletleft)

The thing is there are no arguements (thats good) and this only happens if the variable: shoot is turned on or else it wont shoot.
In the create event of my object: Megaman the variable shoot = false but when you press the S key it equals true, so the variables work and if the S key is pressed then the variable is true and so then it excecutes the script above that I have made. But th thing is, when the bullet is made (there are two bullets, mega_bulletright (moves the bullet to the right in the create event) and mega bullet right (moves the bullet right in the create event) but this doesn't make sense.
If all the left sprites are being presented, I want the left bullet to be created. It works fine for when you are facing right but even if you are facing left the bullet mega_bulletright is created. This doesnt make sense. When you are facing left, all I want is just 1 bullet to be created, nothing else. And when you face right, I just want the 1 bullet to be created. I don't understand how this couldn't of worked...