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: Anything wrong here??

Previous Thread :: Next Thread 
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
13 Mar 2013 12:55 AM
Is there anything wrong with changing the color of a brick using 'local color = etc..' because I dont want to have to write this line over and over.

So heres my example:

local color = BrickColor.new(95,95,95)

script.Parent.MouseButton1Click:connect(function()
if Player.TeamColor == BrickColor.new("Bright green") then
local car = game.Workspace.Startinggrid.Cars.Green
car.Torso.BrickColor = color
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
13 Mar 2013 12:59 AM
Use GetChildren to automate coloring each part.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
13 Mar 2013 01:01 AM
Also brickcolor needs to have a string or number as input. Use color3 if you want to input 3 numbers:

Color3.new(95/255,95/255,95/255)
Report Abuse
CarlosMX is not online. CarlosMX
Joined: 30 Apr 2011
Total Posts: 791
13 Mar 2013 01:04 AM
It worked fine with just 95,95,95 when I tested it a while ago.
Report Abuse
zars15 is not online. zars15
Joined: 10 Nov 2008
Total Posts: 9999
13 Mar 2013 04:07 AM
I bet 95 is color code, so:

BrickColor.new(95)
Report Abuse
TheAwesomenessDude is not online. TheAwesomenessDude
Joined: 17 Jul 2011
Total Posts: 11602
13 Mar 2013 06:43 AM
BrickColor is a value from 0-1...

BrickColor.new(95, 95, 95) shouldn't have worked.

It should be:

BrickColor.new(95/255, 95/255, 95/255) --That will give me a number between 0 and 1
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