# Random from 11111 to 5555

Member Posts: 601

I need a random number generator from 11111 to 55555 with any of these 5 numbers surpassing 5.

• Member Posts: 599

Hello!

I am sure there is an equation you could use. However, here is a simple solution.

Best,
Two.E

• Member Posts: 601

Thx

• Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

Change attribute game.randomNumber to random(11111,55555)

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

• Member Posts: 599

@tatiang

I don't think that was the question. Unless I am missing something, a simple random function won't work when you just want 5 random numbers that are between 1 and 5.

Best,

• Member Posts: 601

@Two.E it's exactly what I wanted, thx

• Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

Yeah, it wasn't clear if it needed to be a 5-digit number or not. Using "number" in place of "digit" confused me.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

• Member, PRO Posts: 5,295
edited February 2019

You can still use a simple random function. Kind of. In this example self.Number is an integer, not a string.

• Member Posts: 599

@Armelline said:
You can still use a simple random function. Kind of. In this example self.Number is an integer, not a string.

I don't think you know how useful that is for me
No way I would have found this in a forum search since I didn't know I needed this till now!!

Best,

• Member, PRO Posts: 5,295

Glad to have helped! Often in GS you have to just try things and see if they work, as sometimes they do even when you wouldn't expect it!