Can't get Scoreboard objective scores with bukkit event

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

dergrosehd

Member
Feb 9, 2020
17
1
3
Germany or Portugal
Hi, I would like to use an expression to read scoreboard objectives. Unfortunately, I get only an error and no output.
My code:
Code:
inport:
    org.bukkit.scoreboard.Score 
expression score of %player% out of [objective] %string%:
    get:
        return Score.getPlayer(expression-1).getObjective(expression-2).getScore()

command /stats [<text>]:
    trigger:
        if arg 1 is "Deaths":
            score of sender out of "Deaths"
            send "You have %{_value}% deaths"
        if arg 1 is "Level":
            score of sender out of "Level"
            send "You are at level %{_value}%"

The error in the console when executing the command:

Code:
[Skript] No matching static method: Score.getPlayer called with (dergrosehd (CraftPlayer))
[Skript] Did you misspell the method? You may have meant to type one of the following:
[Skript] * %Score%.getPlayer

Can soneone help me
 
Status
Not open for further replies.