SFcow
|
  |
| Joined: 16 Jul 2013 |
| Total Posts: 371 |
|
|
| 17 Jul 2013 08:51 PM |
I want to make the "Part" randomly change colors and materials at the same time
Please, can someone help, this is my first day here. Here is what I got so far...
--"yolo" -SFcow while true do
game.Workspace.Part.BrickColor = BrickColor.Random() game.Workspace.Part.Material = Material.Random() wait (.5)
end |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2013 08:54 PM |
You could set the material to...
Whats with those Enum IDs..?
Store them in a table and select a random element from it. |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
| |
|
SFcow
|
  |
| Joined: 16 Jul 2013 |
| Total Posts: 371 |
|
|
| 17 Jul 2013 08:56 PM |
I wanted it to repeat, so I have this now
while true do wait(1) game.Workspace.Part.BrickColor = BrickColor.Random() game.Workspace.Part.Material = Material.new(math.random(), math.random(), math.random())
end |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
SFcow
|
  |
| Joined: 16 Jul 2013 |
| Total Posts: 371 |
|
|
| 17 Jul 2013 08:58 PM |
| All it does is change color once, and then it stops, it doesn't even repeat/ |
|
|
| Report Abuse |
|
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
baheeg
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 72846 |
|
| |
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 17 Jul 2013 09:01 PM |
| @baheeg: You must be joking. Are you joking? Oh, I hope you're joking. |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 17 Jul 2013 09:03 PM |
--"yolo" -SFcow local materials = Enum.Material:GetEnumItems(); while true do game.Workspace.Part.BrickColor = BrickColor.Random() game.Workspace.Part.Material = materials[math.random(#materials)]; wait (.5) end
Wasn't that hard |
|
|
| Report Abuse |
|
|
SFcow
|
  |
| Joined: 16 Jul 2013 |
| Total Posts: 371 |
|
|
| 17 Jul 2013 09:11 PM |
| How about if I wanted it to change shapes? |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 17 Jul 2013 09:13 PM |
| The Shape property is of the Enum PartType, so you would do the same thing, except with Enum.PartType instead of Enum.Material |
|
|
| Report Abuse |
|
|
|
| 17 Jul 2013 09:13 PM |
| You'd do the same thing but you'd use the 'Shape' property and the 'PartType' enum instead. |
|
|
| Report Abuse |
|
|