Aj7Fish
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 500 |
|
|
| 22 Feb 2015 04:40 PM |
Is it possible to pick a specific random color for a part so;
script.Parent.BrickColor = BrickColor.new(math.random("Really red") or ("Really black")) |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 04:41 PM |
| No, so just get a random element from a table containing the colors you want. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 04:56 PM |
| script.Parent.BrickColor = BrickColor.new(math.random()<.5 and "Really red" or "Really black") |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 22 Feb 2015 05:17 PM |
local colors = {BrickColor.new('Really red'); BrickColor.new('Really black')};
script.Parent.BrickColor = colors[math.random(1, #colors)]; |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 05:19 PM |
@Stefan you don't need semicolons. + you need to use commas in your table.
local Colors = { BrickColor.new("Black"), BrickColor.new("White") }
Object.BrickColor = Colors[math.random(1, #Colors)] |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 22 Feb 2015 05:25 PM |
| The semicolons substitute commas in tables. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 05:32 PM |
Correct, however everyone uses commas.
I don't mean to offend your coding style, but it might confuse beginners. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2015 05:32 PM |
| (and by everyone I mean most people) |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 23 Feb 2015 06:36 AM |
One of the best coders here, cntkillme, uses semicolons.
Your move. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 23 Feb 2015 06:50 AM |
You're a wannabe.
Your move. |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 23 Feb 2015 06:51 AM |
| True true, but what does that make you? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 23 Feb 2015 06:53 AM |
"True true, but what does that make you?"
you must be new here |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 23 Feb 2015 06:53 AM |
| I can call you wannabe Skye. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2015 06:53 AM |
| Using; semicolons in scripts; is really dumb; they should only; be used in language; that;s just my opinion; though; |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2015 06:55 AM |
| Lol jk. But don't offend eLunate, she is the new queen of the Scripters forum, by unanimous election. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 23 Feb 2015 06:56 AM |
| She usurped it from dr0id3k4. :) |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
|
| 23 Feb 2015 06:59 AM |
| Pretty much, and people have remarked at how similar she acts to Dr01d3k4. But idk about that, I didn't know Dr01d3k4. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 23 Feb 2015 07:15 AM |
| Also usurped is a very fancy word I had to Google it and even managed to spell usurp wrong. |
|
|
| Report Abuse |
|
|
|
| 23 Feb 2015 08:56 AM |
"No, so just get a random element from a table containing the colors you want.|
"script.Parent.BrickColor = BrickColor.new(math.random()<.5 and "Really red" or "Really black")"
"local colors = {BrickColor.new('Really red'); BrickColor.new('Really black')};"
"local Colors = { BrickColor.new("Black"), BrickColor.new("White") }
Object.BrickColor = Colors[math.random(1, #Colors)]"
No, you're all scripting wannabes.
script.Parent.BrickColor = BrickColor.random()
Your move :D |
|
|
| Report Abuse |
|
|
LucasLua
|
  |
| Joined: 18 Jun 2008 |
| Total Posts: 7386 |
|
| |
|
Aalok
|
  |
| Joined: 20 Jun 2014 |
| Total Posts: 1136 |
|
|
| 23 Feb 2015 09:53 AM |
| colors={BrickColor.new(0);BrickColor.new(255)} part.BrickColor=colors[math.random(1,#colors)] |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 23 Feb 2015 09:56 AM |
"She usurped it from dr0id3k4. :)" wat |
|
|
| Report Abuse |
|
|