Adding variable after successful hits

Discussion in 'Javascript/Plugin Support' started by Padowin1991, Jun 6, 2017.

  1. Padowin1991

    Padowin1991 Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    English
    Hey everyone, i'm using Yanfly's Buffs and States core.

    http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/

    I'm trying to use it in a way so when my character hits an enemy, it raises a variable. I'm making a character who gains stacks to use in a move. Here's how I have my state set up.


    <Custom Confirm Effect>

    // If current action deals HP damage...

    if (this.isHpEffect() && value > 0) {

    // ...set the bonus param damage

    $gameVariables.value(15) += 15;

    }

    </Custom Confirm Effect>

    But I keep getting this error when my player hits an enemy.

    ReferenceError: Invalid left-hand side in assignment

    Anyone know what i'm doing wrong?
     
    #1
  2. Kyo Panda

    Kyo Panda Veteran Veteran

    Messages:
    34
    Likes Received:
    24
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMMV
    Try changing:

    Code:
    $gameVariables.value(15) += 15;
    For:

    Code:
    $gameVariables.setValue(15, $gameVariables.value(15) + 15);
    o/
     
    #2
  3. Padowin1991

    Padowin1991 Villager Member

    Messages:
    9
    Likes Received:
    0
    First Language:
    English
    Thanks for the fast response, it's working perfectly!
     
    #3

Share This Page