Windows empty if statement on spacerocks (GML)

Hello, I have been learning how to use GameMaker for a few hours so I have decided to start the spacerocks project. I'm just starting to create the bullet but theres a error message saying "empty if statement".
I have been trying to fix it for a while, but it still will not go away. I have tried everything. Please help me.
Heres the whole code that I need help with:

if(keyboard_check(vk_left)){
image_angle = image_angle + 5;
}
if(keyboard_check(vk_right)){
image_angle = image_angle - 5;
}

if(keyboard_check(vk_up)){
motion_add(image_angle,0.05);
}


if(keyboard_check_pressed(vk_space));{
var inst = instance_create_layer(x,y "Instances", obj_bullet);
}

move_wrap(true,true,sprite_width/2);
 

FrostyCat

Member
that didn't fix it, it just caused more errors.
It's another mistake you have down the line, unrelated to the excess semicolon. You're missing a comma between the y and "Instances" in this line:
GML:
var inst = instance_create_layer(x,y "Instances", obj_bullet);
Just because you got an error message, that doesn't always mean that is the only place where you've made a mistake. Be more attentive to symbol typos like this going forward.
 
It's another mistake you have down the line, unrelated to the excess semicolon. You're missing a comma between the y and "Instances" in this line:
GML:
var inst = instance_create_layer(x,y "Instances", obj_bullet);
Just because you got an error message, that doesn't always mean that is the only place where you've made a mistake. Be more attentive to symbol typos like this going forward.
I did that, and now my move_wrap(true,true,sprite_width/2); has an error. The error message i'm now getting is Got ';' (eof) expected '}' or 'end'
 
You're code looks like this?! If so the problem is in another place not here..

GML:
if (keyboard_check(vk_left)) {
    image_angle = image_angle + 5;
}

if (keyboard_check(vk_right)) {
    image_angle = image_angle - 5;
}

if (keyboard_check(vk_up)) {
    motion_add(image_angle, 0.05);
}

if (keyboard_check_pressed(vk_space)) { // <-- DID YOU REMOVED THE ";" BEFORE THE "{" ?
    var inst = instance_create_layer(x, y, "Instances", obj_bullet); // <-- DID YOU ADD THE "," after the "y"?
}

move_wrap(true, true, sprite_width / 2);
 
Top