Problem with Personal and Serverwide boosters

  • 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!

In the break event, you would change the asterisk to the %player's uuid%. Changing the booster globally would look kinda like this:

Code:
command enableboost:
   permission: boost.admin
   trigger:
      set {active.booster::*} to "true" # Changes every boost for every player to "true". You could use a loop to make it only affect only online players
      # Add another other num/values needed to make a boost work for a player here
It should set it self already, I changed the skript to this:

Code:
# {type.booster::*} = Booster Type
# {active.booster::*} = Booster active or not
# {time.booster::*} = Time left on booster

command boostergive <integer> [<player>]:
    aliases: /bgive
    permission: op
    trigger:
        if arg-1 is 2, 5, 10, 20 or 30:
            if arg-2 is not set:
                give player 1 orange dye named "&b%arg-1%x &eBooster &f| &b5 minutes"
            else:
                give arg-2 1 orange dye named "&b%arg-1%x &eBooster &f| &b5 minutes"
        else:
            send "&6&lBOOSTER &8» &c[ERROR] &fUnknown booster integer."
command booster:
    trigger:
        if {active.booster::*} is true:
            send "&6&lBOOSTER &8» &fYou have a booster active: &b%{type.booster::*}%&fx Booster, &b%{time.booster::*}% &fminutes remaining."
        else:
            send "&6&lBOOSTER &8» &fYou do not have a booster active."
on rightclick with orange dye:
    if {active.booster::*} is true:
        send "&6&lBOOSTER &8» &c[ERROR] &fYour &b%{type.booster::*}%&fx Booster is already active. &b%{time.booster::*}% &fminutes remaining until you can use another one."
    else:
        if name of player's tool is "&b2x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 2
        else if name of player's tool is "&b5x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 5
        else if name of player's tool is "&b10x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 10
        else if name of player's tool is "&b20x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 20
        else if name of player's tool is "&b30x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 30
        else:
            stop
        remove 1 orange dye named "&b%{type.booster::*}%x &eBooster &f| &b5 minutes" from player
        set {active.booster::*} to true
        set {time.booster::*} to 5
        send "&6&lBOOSTER &8» &fYou enabled your booster! &b%{time.booster::*}% &fminutes remaining."
        while {time.booster::*} is more than 0:
            wait 1 minute
            remove 1 from {time.booster::*}
            send "&6&lBOOSTER &8» &b%{time.booster::*}% &fminute(s) remaining on your booster."
        set {active.booster::*} to false
        clear {type.booster::*}
        send "&6&lBOOSTER &8» &fYour booster period is now over."
 
It should set it self already, I changed the skript to this:

Code:
# {type.booster::*} = Booster Type
# {active.booster::*} = Booster active or not
# {time.booster::*} = Time left on booster

command boostergive <integer> [<player>]:
    aliases: /bgive
    permission: op
    trigger:
        if arg-1 is 2, 5, 10, 20 or 30:
            if arg-2 is not set:
                give player 1 orange dye named "&b%arg-1%x &eBooster &f| &b5 minutes"
            else:
                give arg-2 1 orange dye named "&b%arg-1%x &eBooster &f| &b5 minutes"
        else:
            send "&6&lBOOSTER &8» &c[ERROR] &fUnknown booster integer."
command booster:
    trigger:
        if {active.booster::*} is true:
            send "&6&lBOOSTER &8» &fYou have a booster active: &b%{type.booster::*}%&fx Booster, &b%{time.booster::*}% &fminutes remaining."
        else:
            send "&6&lBOOSTER &8» &fYou do not have a booster active."
on rightclick with orange dye:
    if {active.booster::*} is true:
        send "&6&lBOOSTER &8» &c[ERROR] &fYour &b%{type.booster::*}%&fx Booster is already active. &b%{time.booster::*}% &fminutes remaining until you can use another one."
    else:
        if name of player's tool is "&b2x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 2
        else if name of player's tool is "&b5x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 5
        else if name of player's tool is "&b10x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 10
        else if name of player's tool is "&b20x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 20
        else if name of player's tool is "&b30x &eBooster &f| &b5 minutes":
            set {type.booster::*} to 30
        else:
            stop
        remove 1 orange dye named "&b%{type.booster::*}%x &eBooster &f| &b5 minutes" from player
        set {active.booster::*} to true
        set {time.booster::*} to 5
        send "&6&lBOOSTER &8» &fYou enabled your booster! &b%{time.booster::*}% &fminutes remaining."
        while {time.booster::*} is more than 0:
            wait 1 minute
            remove 1 from {time.booster::*}
            send "&6&lBOOSTER &8» &b%{time.booster::*}% &fminute(s) remaining on your booster."
        set {active.booster::*} to false
        clear {type.booster::*}
        send "&6&lBOOSTER &8» &fYour booster period is now over."
I think that should work
 
I think the type.booster doesn't need the asterisk. I also don't think you need brackets around drops & the type.booster. So with the changes:
Code:
set {drops.%player's uuid%} to {drops.%player's uuid%}*{type.booster::%player's uuid%}
 
I think the type.booster doesn't need the asterisk. I also don't think you need brackets around drops & the type.booster. So with the changes:
Code:
set {drops.%player's uuid%} to {drops.%player's uuid%}*{type.booster::%player's uuid%}
should I change back every {type.booster::*} to {type.booster::%player's uuid%} because it doesn't work now, I don't get any blocks when a booster is activated
 
should I change back every {type.booster::*} to {type.booster::%player's uuid%} because it doesn't work now, I don't get any blocks when a booster is activated
Try sending the {type.booster::*} in a message. If it shows up as "<none>" it means that for some reason nothing is attached to the list & you'll need to make sure that a player is added to that list when they join. If that's not the case, then that means it's probably an issue with the way the booster itself is coded with the break block event.
 
Try sending the {type.booster::*} in a message. If it shows up as "<none>" it means that for some reason nothing is attached to the list & you'll need to make sure that a player is added to that list when they join. If that's not the case, then that means it's probably an issue with the way the booster itself is coded with the break block event.
Yes, I for sure messed up something, because chat should count down from 5 minutes every minute, but instead It just says 5 every minute
 
Yes, I for sure messed up something, because chat should count down from 5 minutes every minute, but instead It just says 5 every minute
I'd recommend separating the "wait 1 minute" part to waiting every minute, then checking if the time isn't zero then removing a value from it. That way it can remove minutes in more accurate increments & prevent it from possible reaching negative values.
 
I'd recommend separating the "wait 1 minute" part to waiting every minute, then checking if the time isn't zero then removing a value from it. That way it can remove minutes in more accurate increments & prevent it from possible reaching negative values.
I'm going to try to figure out something, I'll let you know if I need something or did something right, is it okay for you?
 
  • Like
Reactions: Luke_Sky_Walker