Variable Set To Integer 1-100, can it select one?

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

Aidan

Member
Aug 7, 2020
12
0
1
28
Code:
command /thedailycrate:
    cooldown: 1 second
    cooldown message: &f[&e&lWystrn&f] &cThere is a 1 day cooldown. Be patient!
    trigger:
        set {_random} to a random integer between 1 and 100
        open chest with 1 row named "&2Daily Crate" to player
        message "&f[&eWystrn&f] &aYou got: &a%{_random}%"   

on right click:
    if tool of player is allium named "&2&lDaily Crate Key":
        if world is "world":
            cancel event
            make player execute command "/thedailycrate"

Here's my code.

As you can see in the command /thedailycrate, it sets the variable {_random} to a random integer between 1 and 100. Right now I only have the output as a GUI and a message of the number you got. Is there way to specify that if, you landed on numbers 1 through 5, you recieve XYZ but if you land on numbers 6 through 20, you get ABC (A different output)

Thanks
 
Code:
if {_random} is between 1 and 5:
    #do stuff
else if {_random} is between 6-10:
    #do stuff
else:
    #do something else
 
  • Like
Reactions: Aidan
Status
Not open for further replies.