Random numbers

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

TDragon_

Active Member
Jul 19, 2018
86
1
0
22
How do I make random numbers with a length of 10 letters or more appear in a command?
 
If you mean 10 digits not letters:
code_language.skript:
set {_num} to random integer between 1000000000 and 9999999999

if you actually mean "10 letters" then I dont know what you mean!
 
If you mean 10 digits not letters:
code_language.skript:
set {_num} to random integer between 1000000000 and 9999999999

if you actually mean "10 letters" then I dont know what you mean!
What I mean is, like, have a width. For example: a width of 5, then 82973. Random numbers with any size of digits
[doublepost=1538759220,1538757452][/doublepost]
If you mean 10 digits not letters:
code_language.skript:
set {_num} to random integer between 1000000000 and 9999999999

if you actually mean "10 letters" then I dont know what you mean!
Dude, could you help me with something else too? I am making a password system, and it is only possible to create a password only once per player. How do I do that?
 
What I mean is, like, have a width. For example: a width of 5, then 82973. Random numbers with any size of digits
That I'm not sure how to do. There is probably an easy way to do it, but I'm unsure.

Dude, could you help me with something else too? I am making a password system, and it is only possible to create a password only once per player. How do I do that?
I would suggest looking at Pikachu's JustOK login skript in the resource section, it'll give you a good idea of how to work with passwords.
I personally stay away from anything to do with passwords as Skript is technically a HORRIBLE way to deal with passwords due to a huge lack of security!
 
That I'm not sure how to do. There is probably an easy way to do it, but I'm unsure.


I would suggest looking at Pikachu's JustOK login skript in the resource section, it'll give you a good idea of how to work with passwords.
I personally stay away from anything to do with passwords as Skript is technically a HORRIBLE way to deal with passwords due to a huge lack of security!
Link?
 
Try this (I think this is what you mean):


code_language.skript:
function getRandomNumber(length: number) :: number:
    set {_return} to ""
    loop {_length} times:
        set {_return} to "%{_return}%%random integer between 0 and 9%"
    return {_return} parsed as number
 
Status
Not open for further replies.