Random Number not working

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

    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.

QmanRocks

New Member
Aug 2, 2021
7
0
1
I'm trying to make a random item selector (kinda like Mario Kart) and I have this in my .sk file:
Code:
on step on pressure plate:
    loop 10 times:
        set player's selected hotbar slot to slot 0 of player
        set {_number} to a random number between 1 and 4
        if {_number} is 1:
            set slot 5 of player to 1 oak plank
        if {_number} is 2:
            set slot 5 of player to 1 birch plank
        if {_number} is 3:
            set slot 5 of player to 1 acacia plank
        if {_number} is 4:
            set slot 5 of player to 1 dark oak plank
        wait a tick
But all it does is set my hotbar to the first slot. Nothing appears in slot 5 at all. I'm not sure why this isn't working, as it seems super simple.
 
Status
Not open for further replies.