miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 01 Sep 2011 09:32 PM |
game.Workspace.Part.Transparency = math.random
What would you say to make that work? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Sep 2011 09:34 PM |
| add () to the end, math.random is a function. |
|
|
| Report Abuse |
|
|
superior
|
  |
| Joined: 13 Apr 2008 |
| Total Posts: 1662 |
|
|
| 01 Sep 2011 09:37 PM |
game.Workspace.Part.Transparency = math.random(.1,1)
This will go from .1 to 1.
|
|
|
| Report Abuse |
|
|
superior
|
  |
| Joined: 13 Apr 2008 |
| Total Posts: 1662 |
|
|
| 01 Sep 2011 09:38 PM |
| Not in chronological order though, it will be random.:P |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 01 Sep 2011 09:39 PM |
| OH now I see, so when you say (.1,1) you mean it can be anyway random from .1 - 1? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Sep 2011 09:42 PM |
@superior
I believe you can only put intergers into the parameters of math.random() all though math.random() alone will return a number between 0 and 1. |
|
|
| Report Abuse |
|
|
superior
|
  |
| Joined: 13 Apr 2008 |
| Total Posts: 1662 |
|
|
| 01 Sep 2011 09:45 PM |
| I thought you can put decimals too? |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 01 Sep 2011 09:52 PM |
Even if you could use radians in it, when the function has parameters it'll return an interger thus making it useless. All though there are ways around that :
math.random(0.5)--won't work math.random()/2--will work |
|
|
| Report Abuse |
|
|
superior
|
  |
| Joined: 13 Apr 2008 |
| Total Posts: 1662 |
|
|
| 01 Sep 2011 09:54 PM |
| Hm. Thanks for letting me know this piece of information. :) |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Sep 2011 02:42 PM |
| Well thanks for answering my question. |
|
|
| Report Abuse |
|
|
BCGames
|
  |
| Joined: 30 Dec 2010 |
| Total Posts: 8182 |
|
|
| 02 Sep 2011 02:49 PM |
@Sup
math.random requires integers, not floats. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Sep 2011 02:54 PM |
@BC Example?How to do it not what integers are. |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 02 Sep 2011 02:56 PM |
math.random() returns a random number between 0 and 1 (float) math.random(x,n) returns a random number between x and n (integer)
|
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 02 Sep 2011 02:57 PM |
View http://wiki.roblox.com/index.php/Function_Dump/Mathematical_Functions#math.random_.28.5Bm_.5B.2C_n.5D.5D.29 for other possibilities. |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 02 Sep 2011 02:57 PM |
| Ok, what does x n stand for? |
|
|
| Report Abuse |
|
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
|
| 02 Sep 2011 02:58 PM |
x is the minimum integer number parameter n is the maximum integer number parameter |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
| |
|
Fl0x
|
  |
| Joined: 06 Aug 2010 |
| Total Posts: 5169 |
|
| |
|