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 » Scripting Helpers
Home Search
 

Re: How do I make "Part" changand colors the same?

Previous Thread :: Next Thread 
SFcow is not online. 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
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
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 is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
17 Jul 2013 08:54 PM
[ Content Deleted ]
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
17 Jul 2013 08:55 PM
@baheeg:

...What?
Report Abuse
SFcow is not online. 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 is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
17 Jul 2013 08:57 PM
[ Content Deleted ]
Report Abuse
SFcow is not online. 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 is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
17 Jul 2013 09:00 PM
[ Content Deleted ]
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
17 Jul 2013 09:00 PM
[ Content Deleted ]
Report Abuse
blocco is not online. 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 is not online. 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 is not online. 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 is not online. 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
ColorfulBody is not online. ColorfulBody
Joined: 17 Jun 2012
Total Posts: 2353
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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