Random words

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

AkroDogy2005

Member
Apr 20, 2018
18
1
3
24
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
 
code_language.skript:
add "Tini", "Best" and "Ailumi" to {list::*}
set {nick::%player%} to a random element of {list::*}
 
Or:
code_language.skript:
set {_Random} to a random integer between 1 and 3
if {_Random} = 1:
    send "you set Tini Nick"
else if {_Random} = 2:
    send "you set Best nick"
else if {_Random} = 3:
    send "you set Allumi Nick"
[doublepost=1524572374,1524572333][/doublepost]
code_language.skript:
add "Tini", "Best" and "Ailumi" to {list::*}
set {nick::%player%} to a random element of {list::*}

@TeAm6_AZLIK You should use local variables in this case
 
Or, in one line

code_language.skript:
set {nick::%player%} to random element out of ("Tini", "Best" and "Ailumi")
 
Or:
code_language.skript:
set {_Random} to a random integer between 1 and 3
if {_Random} = 1:
    send "you set Tini Nick"
else if {_Random} = 2:
    send "you set Best nick"
else if {_Random} = 3:
    send "you set Allumi Nick"
[doublepost=1524572374,1524572333][/doublepost]

Why would you do it like that if you could do it in 1 to 2 lines?
 
Last edited:
Status
Not open for further replies.