my skript is not working, for balance and /rankup

Discussion in 'Bukkit Help' started by Electrical_Zap, Jul 7, 2020.

  1. Offline

    Electrical_Zap

    here is the file text:
    Code:
    options:
        prefix: &f&l(&b&lBalBot&f&l)
       
    #Currency =======================================================
    on join:
        if {money.%player%} is not set:
            set {money.%player%} to 0
           
    #Make money =====================================================
    on death:
        attacker is a player
        victim is a player
        add 20 to {money.%attacker%}
        remove 10 from {money.%victim%}
       
    #Pay command ====================================================
    command /pay [<offline player>] [<number>]:
        executable by: player
        trigger:
            if arg 1 or arg 2 is not set:
                send "could not send to player or this player is offline"
            else:
                add number-argument to {money.%arg-1%}
                remove number-argument from {money.%player%}
                send "{@prefix} &Money has been sent to the player."
    
    #Balance command =================================================
    command /balance [<offline player>]:
        executable by: player
        trigger:
            if arg 1 is not set:
                send "{@prefix} &f%player%: &b$%{money.%player%}%"
            else:
                send "{@prefix} &f%arg-1%: &b$%{money.%arg-1%}%"
               
    #Bal command =================================================
    command /bal [<offline player>]:
        executable by: player
        trigger:
            if arg 1 is not set:
                send "{@prefix} &f%player%: &b$%{money.%player%}%"
            else:
                send "{@prefix} &f%arg-1%: &b$%{money.%arg-1%}%"
    
    #Pay (admin command) =============================================
    command /payadmincommand [<offline player>] [<number>]:
        permission: payadmincommand.use
        executable by: player and console
        trigger:
            if arg 1 or arg 2 is not set:
                send "{@prefix} &fUsage: &b/payadmincommand player ammount"
            else:
                add number-argument to {money.%arg-1%}
                send "{@prefix} &fMoney has been sent to the player."
    
    #Set balance (admin command) =====================================
    command /setbalance [<offline player>] [<number>]:
        permission: setbalance.use
        executable by: player and console
        trigger:
            if arg 1 or arg 2 is not set:
                send "{@prefix} &fUsage: &b/setbalance player ammount"
            else:
                set {money.%arg-1%} to number-argument
                send "{@prefix} &fPlayer's balance has been set."
               
    #Reset player's balance (admin command) =============================
    command /resetbalance [<offline player>]:
        permission: resetbalance.use
        executable by: player and console
        trigger:
            if arg 1 is not set:
                send "{@prefix} &fUsage: &b/resetbalance player"
            else:
                set {money.%player%} to 0
                send "{@prefix} &fPlayer's balance has been reset."
    
    command /rankup:
        trigger:
            if player's group is "Default":
                If {money.%player%} is more than 999:
                    execute console command "/pex user %player% group set Knight-1"
                    broadcast "&cServer>> &b%player% just ranked up to &3Knight-1!"
                    remove 1000 from  {money.%player%}
                else:
                    message "&cServer>> &eYou don't have enough money to rankup!"
            if player's group is "Knight-1":
                If {money.%player%} is more than 9990:
                    execute console command "/pex user %player% group set Knight-2"
                    broadcast "&cServer>> &b%player% just ranked up to &3Knight-2!"
                    remove 2000 {money.%player%}
                else:
                    message "&cServer>> &eYou don't have enough money to rankup!"
    I'm new to skripting and this is one of my first skripts. Minecraft says this.
    "Cant compair 'group of player' with a text "line 3 'if group of player is default"
    and "Cant compair 'group of player' with a text "line 3 'if group of player is knight-1"

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 7, 2020
  2. Offline

    KarimAKL

    @Electrical_Zap Which part of it is "not working"? What happens? What'd you expect to happen?
     
  3. Offline

    Electrical_Zap

    it is supposed to do /rankup, and if the player has enough money, they become a Knight.

    wait, I fixed it. syntax error.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 7, 2020

Share This Page