My roulette command, doesnt work! Please 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.

lions788

New Member
Sep 5, 2019
5
0
1
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!"
 
can you put your code in a code block please.
Its impossible to read your code when its all in one line without indentations.
 
can you put your code in a code block please.
Its impossible to read your code when its all in one line without indentations.

Code:
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!"
 
How do I put my code into a code block?
Screen Shot 2019-09-09 at 5.04.38 PM.png
 
Status
Not open for further replies.