Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
|
| 10 Jan 2017 06:48 PM |
The concept is simple; a person has to guess a random number. If they don't, their tries increases by one. The problem is, the number isn't really 'random'. It's ALWAYS 17 or 97. I want to be able to randomize this WITHOUT obstructing the 'Num' variable. Yes, I am aware of math.randomseed, but that'll basically stop the WHOLE script.
|
|
|
| Report Abuse |
|
|
Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
|
| 10 Jan 2017 06:49 PM |
oops. Script:
local Guess = script.Parent.Parent.TextB local Enter = script.Parent local GuessedLabel = script.Parent.Parent.GuessedOrNot numtries = 0 local Num = math.random(1,98) print(Num)
Enter.MouseButton1Down:connect(function() wait() Enter.Text = "ENTER" if ton####################N#m###en numtries = numtries + 1 GuessedLabel.TextColor3 = Color3.new(255, 0, 0) GuessedLabel.Text = "The correct number is higher than the number you guessed. Try again!" wait(2.5) GuessedLabel.Text = " " GuessedLabel.TextColor3 = Color3.new(35, 35, 35) elseif to#################### #u###hen numtries = numtries + 1 GuessedLabel.TextColor3 = Color3.new(255, 0, 0) GuessedLabel.Text = "The correct number is lower than the number you guessed. Try again!" wait(2.5) GuessedLabel.Text = " " GuessedLabel.TextColor3 = Color3.new(35, 35, 35) elseif ton#################### ##m###d numtries < 5 and numtries ~= 0 then numtries = numtries + 1 GuessedLabel.TextColor3 = Color3.new(0, 200, 0) GuessedLabel.Text = "Congratulations! You have guessed the correct number in " ..numtries.. " turns. Awesome!" wait(2.5) GuessedLabel.Text = " " Enter.Text = "Click to try again!" local Num = math.random(1,98) GuessedLabel.TextColor3 = Color3.new(35, 35, 35) elseif to####################=##u###nd numtries == 0 then numtries = numtries + 1 GuessedLabel.TextColor3 = Color3.new(234, 255, 2) GuessedLabel.Text = "AMAZING. YOU HAVE DONE THE IMPOSSIBLE. YOU HAVE GUESSED THE CORRECT NUMBER IN ONLY 1 TRY!" wait(2.5) GuessedLabel.Text = " " GuessedLabel.TextColor3 = Color3.new(35, 35, 35) Enter.Text = "Click to try again!" local Num = math.random(1,98) elseif tonumber(Guess.Text) and numtries >= 5 then GuessedLabel.TextColor3 = Color3.new(0, 200, 0) numtries = numtries + 1 GuessedLabel.Text = "Finally! You've guessed the number! It took you " ..numtries.. " turns. Pretty decent, but you can do better!" wait(2.5) GuessedLabel.Text = " " Enter.Text = "Click to try again!" GuessedLabel.TextColor3 = Color3.new(35, 35, 35) local Num = math.random(1,98)
end end)
The tags are GuessLabel DOT text
|
|
|
| Report Abuse |
|
|
| |
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 10 Jan 2017 06:51 PM |
math.random(1,(math.random(1,math.random(1,math.random(1,100)))))
this number would favor smaller numbers more than larger ones, however.
You could alternate it between
1, random random, 100
etc
randomseed would only affect the person if they were only person in server, rolled, figured out number of first roll, and then rejoined a server and knew the answer
a way to counter that withou randomseed would be
for i = 1, math.random(1,300) do math.random(1,100) -- or whatever ur max is end
|
|
|
| Report Abuse |
|
|
Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
| |
|
Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
|
| 10 Jan 2017 06:57 PM |
With that script, the number is always two. (the top one. I only want to have one variable, so I'm using the top one.)
|
|
|
| Report Abuse |
|
|
| |
|
Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
| |
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 10 Jan 2017 07:37 PM |
try to help a noob and he just mocks u
|
|
|
| Report Abuse |
|
|
Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
|
| 10 Jan 2017 07:46 PM |
im not?? i was saying that to bump the post. also, ive been in roblox for 3 years, im not considered a noob anymore
|
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
| |
|
Vid_eo
|
  |
| Joined: 30 Jul 2013 |
| Total Posts: 2580 |
|
|
| 10 Jan 2017 09:03 PM |
even if i were, i wasnt making fun of you.. i was bumping the post with things such as 12ab.
|
|
|
| Report Abuse |
|
|