Checking Scoreboard Score

Discussion in 'Plugin Development' started by ItsMees, Nov 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    ItsMees

    Hi,
    I just saw an scoreboard tutorial and it was great!
    But I need help with something that the tutorial didnt tell!
    I need help with checking the score of an player!
    I tryd something like this:
    Code:java
    1. if (score.getScore() = "1"){
    2.  
    3. }

    But it doesnt work and the code is not right it gives arrors!


    I hope you can help me out!
    Bye,
    ItsMees (ThePluginBros)
     
  2. Offline

    Mmarz11

    getScore() will return an int value so you will need to compare it to an int not a String. Also, = is used to assign variables a value and == is used to compare certain values.

    Code:java
    1. if (score.getScore() == 1) {
    2.  
    3. }


    ItsMees
     
  3. Offline

    ItsMees

    Thanks It Works!
     
  4. Offline

    calebbfmv

    Mark as solved?
     
Thread Status:
Not open for further replies.

Share This Page