Solved Balance Booster Help

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

xIName

New Member
Apr 6, 2020
5
1
3
23
Okay so, I'm new to skripting and i tried to make a balancebooster. I get no errors, but I can run a new balancebooster while one is enabled. I also want the balance booster to get removed after 1 hour. Can someone please help me? :emoji_slight_smile: Btw I made a /Shop command, and when players buy the Booster they get the permission boost.balance. I also want that permission removed when they execute the command.
Code:
command /eboost <text>:
    permission: boost.balance
    permission message: &8[&cNight&8] &7You do not have any &9&lBalance Boosters&7! &f(&c/shop&f)
    trigger:
        if arg-1 is not set:
            message "&7Usage: &c/eboost balance"
        else if arg-1 is "balance":
            broadcast "&E"
            broadcast "&8[&cNight&8] &71 hour &9&lBalance Booster &7has been activated by &c%player%! &f(&c/shop&f)"
            broadcast "&E"
            make console execute command "sk disable killermoney"
            make console execute command "sk enable killermoney2"
            set {balanceboost.%player%} to "yes"
        if {balanceboost%player%} is yes:
            stop
            send "&8[&cNight&8] &7There is already a running &9&lBalance Booster&7."
 
Last edited:
Using strings as booleans is sometimes a bad idea, might want to replace:
Code:
set {balanceboost.%player%} to "yes"
with:
Code:
set {balanceboost.%player%} to true

Also, if you set it to a string, "yes", you must type it as a string in an if condition:
Code:
THIS IS BAD: if {balanceboost%player%} is yes:
THIS IS GOOD: if {balanceboost%player%} is "yes":
.

permission removed when they execute the command.
You can make the console execute the command to remove the permission, use your permission manager
 
Using strings as booleans is sometimes a bad idea, might want to replace:
Code:
set {balanceboost.%player%} to "yes"
with:
Code:
set {balanceboost.%player%} to true

Also, if you set it to a string, "yes", you must type it as a string in an if condition:
Code:
THIS IS BAD: if {balanceboost%player%} is yes:
THIS IS GOOD: if {balanceboost%player%} is "yes":
.


You can make the console execute the command to remove the permission, use your permission manager
Thank you! I will try it when i get back home.
[doublepost=1586539134,1586185256][/doublepost]
Using strings as booleans is sometimes a bad idea, might want to replace:
Code:
set {balanceboost.%player%} to "yes"
with:
Code:
set {balanceboost.%player%} to true

Also, if you set it to a string, "yes", you must type it as a string in an if condition:
Code:
THIS IS BAD: if {balanceboost%player%} is yes:
THIS IS GOOD: if {balanceboost%player%} is "yes":
.


You can make the console execute the command to remove the permission, use your permission manager
It didnt, work. Still get no errors but I can execute the command while a booster is activated.
 
Hey, with this code it will be removed after an hour and while command-boost is set, the player can not execute the command.

Code:
command /eboost <text>:
  permission: boost.balance
  permission message: &8[&cNight&8] &7You do not have any &9&lBalance Boosters&7! &f(&c/shop&f)
  trigger:
    if arg-1 is not set:
      message "&7Usage: &c/eboost balance"
    else if arg-1 is "balance":
      {balanceboost.%player%} is not set:
        broadcast "&E"
        broadcast "&8[&cNight&8] &71 hour &9&lBalance Booster &7has been activated by &c%player%! &f(&c/shop&f)"
        broadcast "&E"
        make console execute command "sk disable killermoney"
        make console execute command "sk enable killermoney2"
        set {balanceboost.%player%} to true
        wait 1 hour
        delete {balanceboost.%player%}
      else:
        send "&8[&cNight&8] &7There is already a running &9&lBalance Booster&7."
 
Hey, with this code it will be removed after an hour and while command-boost is set, the player can not execute the command.

Code:
command /eboost <text>:
  permission: boost.balance
  permission message: &8[&cNight&8] &7You do not have any &9&lBalance Boosters&7! &f(&c/shop&f)
  trigger:
    if arg-1 is not set:
      message "&7Usage: &c/eboost balance"
    else if arg-1 is "balance":
      {balanceboost.%player%} is not set:
        broadcast "&E"
        broadcast "&8[&cNight&8] &71 hour &9&lBalance Booster &7has been activated by &c%player%! &f(&c/shop&f)"
        broadcast "&E"
        make console execute command "sk disable killermoney"
        make console execute command "sk enable killermoney2"
        set {balanceboost.%player%} to true
        wait 1 hour
        delete {balanceboost.%player%}
      else:
        send "&8[&cNight&8] &7There is already a running &9&lBalance Booster&7."
Thank you so much, it works perfectly <3
 
  • Like
Reactions: HiqqhFive
Status
Not open for further replies.