malformed if statement, pls help!!!

Discussion in 'Programming' started by Tatum_vt, Apr 15, 2019.

  1. Tatum_vt

    Tatum_vt Member

    Joined:
    Apr 15, 2019
    Posts:
    11
    hii I'm really new at this, and I wrote a line of code, where I get the error:
    Script: PlayerState_Attack_Stab at line 4 : malformed if statement
    But I don't see what's wrong, pls help!!

    my code:




    //Start of the attack
    if (sprite_index != sPlayerS);
    {
    sprite_index = sPlayerS;
    image_index = 0;
    ds_list_clear (hitByAttack);
    }

    //Use attack bitbox & check for hits
    mask_index =sPlayerSHB;
     
  2. RefresherTowel

    RefresherTowel Member

    Joined:
    Jul 13, 2016
    Posts:
    1,222
    Code:
    if (sprite_index != sPlayerS);
    Remove the ; from the end. ; does not belong at the end of an if, for, while, etc statements.
     
    Tatum_vt likes this.
  3. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,852
    Tatum_vt likes this.
  4. Tatum_vt

    Tatum_vt Member

    Joined:
    Apr 15, 2019
    Posts:
    11
    Thank you!!!
     
    RefresherTowel likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice