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.

My roulette command, doesnt work! Please help

Discussion in 'Skript' started by lions788, Sep 8, 2019.

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

    lions788 New Member

    Joined:
    Sep 5, 2019
    Messages:
    5
    Likes Received:
    0
    So im on minehut and I created this roulette command and when I execute the command /roulette red 100000 nothing happens, there are no errors in the skript. but when I do the command nothing pops up in the chat and I cant seem to figure it out.


    command /roulette <text> [<integer>]:
    trigger:
    set {_red} to 0
    set {_black} to 0
    set {_choose} to 0
    if arg 1 is "red":
    if arg 2 is greater than {balance::%player%}:
    message "&4&lYou cannot bet an amount more than your current balance!"
    else if arg 2 is less than {balance::%player%}:
    set {_choose} to a random integer between 1 and 2
    if {_choose} is 1:
    set {_red} to arg 2
    message "&7&lYou were lucky and won &a&l%{_red}%&7&l!"
    add {_red} to {balance::%player%}
    set {_red} to 0
    else if {_choose} is 2:
    set {_red} to arg 2
    message "&c&lYou were unlucky and lost &4&l%{_red}%&c&l!"
    subtract {_red} from {balance::%player%}
    set {_red} to 0
    else if arg 1 is "black":
    if arg 2 is greater than {balance::%player%}:
    message "&4&lYou cannot bet an amount more than your current balance!"
    else if arg 2 is less than {balance::%player%}:
    set {_choose} to a random integer between 1 and 2
    if {_choose} is 1:
    set {_black} to arg 2
    message "&7&lYou were lucky and won &a&l%{_black}%&7&l!"
    add {_black} to {balance::%player%}
    set {_black} to 0
    else if {_choose} is 2:
    set {_black} to arg 2
    message "&c&lYou were unlucky and lost &4&l%{_black}%&c&l!"
    subtract {_black} from {balance::%player%}
    set {_black} to 0
    else:
    message "&c&lYou have entered the command wrong, please try again!"
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    can you put your code in a code block please.
    Its impossible to read your code when its all in one line without indentations.
     
  3. LukynkaCZE

    LukynkaCZE Member

    Joined:
    May 12, 2019
    Messages:
    26
    Likes Received:
    2
    Code (Text):
    1. command /roulette <text> [<integer>]:
    2.     trigger:
    3.         set {_red} to 0
    4.         set {_black} to 0
    5.         set {_choose} to 0
    6.         if arg 1 is "red":
    7.             if arg 2 is greater than {balance::%player%}:
    8.             message "&4&lYou cannot bet an amount more than your current balance!"
    9.         else if arg 2 is less than {balance::%player%}:
    10.             set {_choose} to a random integer between 1 and 2
    11.             if {_choose} is 1:
    12.                 set {_red} to arg 2
    13.                 message "&7&lYou were lucky and won &a&l%{_red}%&7&l!"
    14.                 add {_red} to {balance::%player%}
    15.                 set {_red} to 0
    16.             else if {_choose} is 2:
    17.                 set {_red} to arg 2
    18.                 message "&c&lYou were unlucky and lost &4&l%{_red}%&c&l!"
    19.                 subtract {_red} from {balance::%player%}
    20.                 set {_red} to 0
    21.                 else if arg 1 is "black":
    22.                     if arg 2 is greater than {balance::%player%}:
    23.                         message "&4&lYou cannot bet an amount more than your current balance!"
    24.                     else if arg 2 is less than {balance::%player%}:
    25.                         set {_choose} to a random integer between 1 and 2
    26.                         if {_choose} is 1:
    27.                             set {_black} to arg 2
    28.                             message "&7&lYou were lucky and won &a&l%{_black}%&7&l!"
    29.                             add {_black} to {balance::%player%}
    30.                             set {_black} to 0
    31.                         else if {_choose} is 2:
    32.                             set {_black} to arg 2
    33.                             message "&c&lYou were unlucky and lost &4&l%{_black}%&c&l!"
    34.                             subtract {_black} from {balance::%player%}
    35.                             set {_black} to 0
    36.         else:
    37.             message "&c&lYou have entered the command wrong, please try again!"
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    looks like your indentation is all off, starting at line 8
     
  5. lions788

    lions788 New Member

    Joined:
    Sep 5, 2019
    Messages:
    5
    Likes Received:
    0
    How do I put my code into a code block?
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    232
    Screen Shot 2019-09-09 at 5.04.38 PM.png
     
  7. lions788

    lions788 New Member

    Joined:
    Sep 5, 2019
    Messages:
    5
    Likes Received:
    0
Thread Status:
Not open for further replies.

Share This Page

Loading...