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 to select math.random

Previous Thread :: Next Thread 
DevSersponge is not online. DevSersponge
Joined: 01 Jan 2016
Total Posts: 79
23 Jun 2016 09:21 PM
How do I select the number generated by math.random in the script and make it -30 is it possible?
Report Abuse
DevSersponge is not online. DevSersponge
Joined: 01 Jan 2016
Total Posts: 79
23 Jun 2016 09:25 PM
And set the number generated as a variable like a = number
Report Abuse
jody7777 is not online. jody7777
Joined: 22 Feb 2009
Total Posts: 1343
23 Jun 2016 09:26 PM
multiplication


FOR THE CAUSE
Report Abuse
DevSersponge is not online. DevSersponge
Joined: 01 Jan 2016
Total Posts: 79
23 Jun 2016 09:30 PM
Please be a little bit more specific
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
23 Jun 2016 09:31 PM
Is it really a random number if you're selecting it?
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
23 Jun 2016 09:36 PM
-30 / math.random()

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
DevSersponge is not online. DevSersponge
Joined: 01 Jan 2016
Total Posts: 79
23 Jun 2016 09:47 PM
But how I select it
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
23 Jun 2016 10:00 PM
wtf are you talking about

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
Kodran is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
23 Jun 2016 10:10 PM
ohh like

a = math.random(1, 100) - 30

???
Report Abuse
intel is not online. intel
Joined: 09 May 2008
Total Posts: 32
23 Jun 2016 10:43 PM
var = math.random()-30
Report Abuse
Skellobit is not online. Skellobit
Joined: 13 Apr 2016
Total Posts: 12758
24 Jun 2016 12:32 PM
I thought he meant manipulating the number returned by math.random() to turn it into -30 (multiplication)

Formerly ToxicDominator - add 17,509 posts | :(){:|:&};:
Report Abuse
DevSersponge is not online. DevSersponge
Joined: 01 Jan 2016
Total Posts: 79
24 Jun 2016 08:05 PM
@kodran yes
Report Abuse
TheBenSquare is not online. TheBenSquare
Joined: 13 Dec 2009
Total Posts: 13604
24 Jun 2016 08:07 PM
local options = {1,-1}
local other = {}

local result = (other[math.random(1,#other)] * options[math.random(1,#options)])
Report Abuse
adoman is not online. adoman
Joined: 01 Sep 2010
Total Posts: 306
24 Jun 2016 08:12 PM
local num1 = 2
local num2 = 40000

local myNum = math.random(num1, num2)
myNum = -30
Report Abuse
Luckify is not online. Luckify
Joined: 11 Aug 2012
Total Posts: 701
24 Jun 2016 08:52 PM
math.random() * 30
Report Abuse
iFallenAtlantis is not online. iFallenAtlantis
Joined: 29 Feb 2012
Total Posts: 240
24 Jun 2016 09:37 PM
local math1 = 30
local math2 = 60
local subtractThirty = false

local randomMath = math.random(math1, math2)
if subtractThirty == true then
local endMath = randomMath - 30
print(endMath)
else
endMath = randomMath
print(endMath)
end



--I can put my waits wherever I want!
Report Abuse
Exanimatedn9dean is online. Exanimatedn9dean
Joined: 11 Aug 2015
Total Posts: 1469
24 Jun 2016 09:39 PM
num = math.random(1,100)
num - 30
Report Abuse
jody7777 is not online. jody7777
Joined: 22 Feb 2009
Total Posts: 1343
24 Jun 2016 11:44 PM
maxRecursionDepth = maxRecursionDepth or 10
local eps = calculus.doubleEpsilon
if torch.typename(a) == 'torch.FloatTensor' then
eps = calculus.floatEpsilon
end
local c = (a+b)/2
local h = b - a
local fa = f(a)
local fb = f(b)
local fc = f(c)
local S = (h/6) * (fa + 4*fc + fb)
return aSimpsonsRecursion(f, a, b, eps, S, fa, fb, fc, maxRecursionDepth)


FOR THE CAUSE
Report Abuse
DevSersponge is not online. DevSersponge
Joined: 01 Jan 2016
Total Posts: 79
25 Jun 2016 01:54 AM
Thx bye
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