1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Balance Booster Help

Discussion in 'Skript' started by xIName, Apr 6, 2020.

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

    xIName New Member

    Joined:
    Apr 6, 2020
    Messages:
    5
    Likes Received:
    1
    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 (Text):
    1. command /eboost <text>:
    2.     permission: boost.balance
    3.     permission message: &8[&cNight&8] &7You do not have any &9&lBalance Boosters&7! &f(&c/shop&f)
    4.     trigger:
    5.         if arg-1 is not set:
    6.             message "&7Usage: &c/eboost balance"
    7.         else if arg-1 is "balance":
    8.             broadcast "&E"
    9.             broadcast "&8[&cNight&8] &71 hour &9&lBalance Booster &7has been activated by &c%player%! &f(&c/shop&f)"
    10.             broadcast "&E"
    11.             make console execute command "sk disable killermoney"
    12.             make console execute command "sk enable killermoney2"
    13.             set {balanceboost.%player%} to "yes"
    14.         if {balanceboost%player%} is yes:
    15.             stop
    16.             send "&8[&cNight&8] &7There is already a running &9&lBalance Booster&7."


     
    #1 xIName, Apr 6, 2020
    Last edited: Apr 6, 2020
  2. Best Answer:
    Post #4 by HiqqhFive, Apr 10, 2020
  3. GuardDev

    GuardDev Member

    Joined:
    Apr 5, 2020
    Messages:
    19
    Likes Received:
    4
    Using strings as booleans is sometimes a bad idea, might want to replace:
    Code (Text):
    1. set {balanceboost.%player%} to "yes"
    with:
    Code (Text):
    1. 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 (Text):
    1. THIS IS BAD: if {balanceboost%player%} is yes:
    2. THIS IS GOOD: if {balanceboost%player%} is "yes":
    .

    You can make the console execute the command to remove the permission, use your permission manager
     
  4. xIName

    xIName New Member

    Joined:
    Apr 6, 2020
    Messages:
    5
    Likes Received:
    1
    Thank you! I will try it when i get back home.
    --- Double Post Merged, Apr 10, 2020, Original Post Date: Apr 6, 2020 ---
    It didnt, work. Still get no errors but I can execute the command while a booster is activated.
     
  5. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    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 (Text):
    1. command /eboost <text>:
    2.   permission: boost.balance
    3.   permission message: &8[&cNight&8] &7You do not have any &9&lBalance Boosters&7! &f(&c/shop&f)
    4.   trigger:
    5.     if arg-1 is not set:
    6.       message "&7Usage: &c/eboost balance"
    7.     else if arg-1 is "balance":
    8.       {balanceboost.%player%} is not set:
    9.         broadcast "&E"
    10.         broadcast "&8[&cNight&8] &71 hour &9&lBalance Booster &7has been activated by &c%player%! &f(&c/shop&f)"
    11.         broadcast "&E"
    12.         make console execute command "sk disable killermoney"
    13.         make console execute command "sk enable killermoney2"
    14.         set {balanceboost.%player%} to true
    15.         wait 1 hour
    16.         delete {balanceboost.%player%}
    17.       else:
    18.         send "&8[&cNight&8] &7There is already a running &9&lBalance Booster&7."
    19.  
     
  6. xIName

    xIName New Member

    Joined:
    Apr 6, 2020
    Messages:
    5
    Likes Received:
    1
    Thank you so much, it works perfectly <3
     
    • Like Like x 1
  7. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    You're welcome.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...