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.

Random words

Discussion in 'Skript' started by AkroDogy2005, Apr 23, 2018.

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

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    18
    Likes Received:
    1
    Any way to select a random word with skript?

    Ex

    select a random word of "Tini" and "Best" and "Ailumi"
    If word is "tini":
    Send "you set Tini nick" to player
    If word is "Best" :
    Send "you set Best nick" to player


    This is a example, this is not work
     
  2. TeAm6_AZLIK

    TeAm6_AZLIK Member

    Joined:
    Dec 5, 2017
    Messages:
    23
    Likes Received:
    0
    Code (Skript):
    1. add "Tini", "Best" and "Ailumi" to {list::*}
    2. set {nick::%player%} to a random element of {list::*}
     
  3. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    379
    Likes Received:
    9
    Or:
    Code (Skript):
    1. set {_Random} to a random integer between 1 and 3
    2. if {_Random} = 1:
    3.     send "you set Tini Nick"
    4. else if {_Random} = 2:
    5.     send "you set Best nick"
    6. else if {_Random} = 3:
    7.     send "you set Allumi Nick"
    --- Double Post Merged, Apr 24, 2018, Original Post Date: Apr 24, 2018 ---
    @TeAm6_AZLIK You should use local variables in this case
     
  4. Mr_Simba

    Mr_Simba King of the Pridelands
    Supporter

    Joined:
    Dec 9, 2016
    Messages:
    256
    Likes Received:
    56
    Medals:
    Or, in one line

    Code (Skript):
    1. set {nick::%player%} to random element out of ("Tini", "Best" and "Ailumi")
     
  5. TeAm6_AZLIK

    TeAm6_AZLIK Member

    Joined:
    Dec 5, 2017
    Messages:
    23
    Likes Received:
    0
    Why would you do it like that if you could do it in 1 to 2 lines?
     
    #5 TeAm6_AZLIK, Apr 28, 2018
    Last edited: Apr 30, 2018
  6. AkroDogy2005

    AkroDogy2005 Member

    Joined:
    Apr 20, 2018
    Messages:
    18
    Likes Received:
    1
Thread Status:
Not open for further replies.

Share This Page

Loading...