generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How would I make this number- thing completely random?

Previous Thread :: Next Thread 
Vid_eo is not online. 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 is not online. 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
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
10 Jan 2017 06:49 PM
math.randomseed(tick())
Report Abuse
Wowgnomes is online. 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 is not online. Vid_eo
Joined: 30 Jul 2013
Total Posts: 2580
10 Jan 2017 06:54 PM
12


Report Abuse
Vid_eo is not online. 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
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Jan 2017 07:03 PM
what are u even saying
Report Abuse
Vid_eo is not online. Vid_eo
Joined: 30 Jul 2013
Total Posts: 2580
10 Jan 2017 07:18 PM
1bawabd


Report Abuse
Wowgnomes is online. 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 is not online. 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 is online. Wowgnomes
Joined: 27 Sep 2009
Total Posts: 26255
10 Jan 2017 07:50 PM
you are a noob


Report Abuse
Vid_eo is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image