# Solved Help with a number generator

Discussion in 'Requests' started by chasebennetthill, Feb 13, 2020.

1. ### chasebennetthill Member

Joined:
Feb 13, 2020
Messages:
2
0
hello i have made some code to make a number gen all works fine but if the number is 5 then users can win with 55 15 25 or pretty much any number with five in it
Code (Text):
1.
2.
3. variables:
4.     {number} =  0
5.     {numberon} = 0
6.
7.
8.
9.
10. every 100 seconds:
11.     set {number} to random integer between 1 and 10
12.     set {numberon} to 1
13.     broadcast "&c&l[Dino&6&lVerse] &cI am thinking of a number between 1 and 10 try and guess it!"
14.
15.
16. on chat:
17.     if message contains "%{number}%":
18.         if {numberon} = 1:
19.             broadcast "&e&l[Dino&6&lVerse] &c%Player% Guessed my number!"
20.             set {numberon} to 0
21.
22.
23.
--- Double Post Merged, Feb 14, 2020, Original Post Date: Feb 13, 2020 ---
please i need help??

#1
Post #2 by Goose, Feb 16, 2020
3. ### Goose Well-Known Member

Joined:
Nov 23, 2019
Messages:
373
21
Considering the parser is down, the code i'll work on to give you might have errors as I can't test it on a school chromebook. I'll notify you when it's done.
--- Double Post Merged, Feb 16, 2020, Original Post Date: Feb 16, 2020 ---
Try this, it should work

Code (Text):
1. every 100 seconds:
2.     set {number} to random integer between 1 and 10
3.     set {numberon} to true
4.     broadcast "&c&l[Dino&6&lVerse] &cI am thinking of a number between 1 and 10 try and guess it!"
5. on chat:
6.     if {numberon} is true:
7.         if message is "%{number}%":
8.             broadcast "&e&l[Dino&6&lVerse] &c%Player% Guessed my number!"
9.             set {numberon} to false

#2
4. ### chasebennetthill Member

Joined:
Feb 13, 2020
Messages:
2
0
Thanks I used this and now it works

#3
• Friendly x 1
5. ### Goose Well-Known Member

Joined:
Nov 23, 2019
Messages:
373
21
No problem, make sure to mark the post as solved!

#4
6. ### TheCringleYT Well-Known Member

Joined:
Sep 29, 2019
Messages:
103
2
Waaaaaaaiiiiiiiii.... School Chromebook? I have them too lmao.

#5
7. ### TenToTu Sho Member

Joined:
Dec 30, 2019
Messages:
12
1
Also, for the future, you put "if message contains {number}", which would work, even if a player types "12345678910", because the message does indeed contain the number. So careful about that, and remember to replace it with "if message is {number}"

#6
• ### About Us

Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.
• ### Support skUnity

The staff team works very hard to make sure the community is running its best. This means constantly performing upgrades to systems and other features. This does cost a bit of money to keep doing. Donating to skUnity would allow the server to keep running smoothly for years to come!

Support Us!