Solved How to make a math.random in skript.

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

SlayerDoesYT

New Member
Aug 3, 2018
6
0
0
Hi, I am wondering if anyone would be able to help me make a math.random skript so that when a player ranks up they have a 20% chance of winning a rank up key. and if they lose it sends them a message like sorry better luck next time or something like that
 
well I guess it depends how you have your rankup skript written, but basically just throw this into your effects
code_language.skript:
chance of 20%:
    #code here to give player the key
else:
    send "better luck next time" to player
 
command /test5:
chance of 20%:
send "&fPlugins (0):"
else
send "&fPlugins (1):"

that is just my way of seeing if it would work after I couldn't get it to work the first time
 
code_language.skript:
command /test5:
    chance of 20%:
        send "&fPlugins (0):"
    else
        send "&fPlugins (1):"
 
code_language.skript:
command /test5:
    chance of 20%:
        send "&fPlugins (0):"
    else
        send "&fPlugins (1):"
try this instead
code_language.skript:
command /test5:
    trigger:
        chance of 20%:
            send "&fPlugins (0):"
        else
            send "&fPlugins (1):"
 
Now It no longer says that its an unknown command in game but nothing happens when I type in the command
[doublepost=1533358557,1533358503][/doublepost]It also says "else is not a list!" when I reload skript
 
oh oops. theres no colon after else.... add that and it works, just tested it
 
Status
Not open for further replies.