|
| 30 Nov 2012 08:42 PM |
OKay, here is my script (I am learning) base=game.Workspace.BasePlate base.Locked=true base.Anchored=true base.TopSurface="Universal" base.BrickColor="White"
Here is my output: 21:38:55 - Workspace.Script:5: bad argument #3 to '?' (BrickColor expected, got string) 21:38:55 - Script "Workspace.Script", Line 5 21:38:55 - stack end
What am I doing wrong/how do I change the color? |
|
|
| Report Abuse |
|
|
Raphael7
|
  |
| Joined: 03 Dec 2008 |
| Total Posts: 2479 |
|
|
| 30 Nov 2012 08:44 PM |
| base.BrickColor = BrickColor.new("COLORNAME") -- Must be a valid BrickColor |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Nov 2012 09:02 PM |
| Okay, it works, but why doesn't my origninal work? Has lua updated out of those ways? |
|
|
| Report Abuse |
|
|
OBF
|
  |
| Joined: 29 Sep 2009 |
| Total Posts: 10709 |
|
|
| 30 Nov 2012 09:03 PM |
| When you set a color, the value has to be a BrickColor, hence BrickColor.new. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:05 PM |
If I were to say base.TopSurface=new.TopSurface("Studs") Would that work? Why does =new.BrickColor() have to be applied but not =new.TopSurface() need to be applied? Where does/doesnt and why? |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:15 PM |
No... you just do base.TopSurface = "Studs"
or with the enum:
base.TopSurface = 3
or with even more typing ._.
base.TopSurface = base.TopSurface.Studs
A BrickColor value is a specific color value. They are used instead of Color3 values on bricks and other 3D objects. Each BrickColor has a numeric id, that represents the color. For example, 1 is white, and 45 is a light blue. There are many different colors available: see the list here.
http://wiki.roblox.com/index.php/BrickColor_Codes
~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:16 PM |
Just to let you know, Color3 values are used for GUI's, which are 2D objects.
~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:17 PM |
> They are used instead of Color3 values on bricks and other 3D objects
BasePart.Color = Color3.new()
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:20 PM |
> Just to let you know, Color3 values are used for GUI's, which are 2D objects.
It's not limited to Color3. You can change the BackgroundColor property, for example, and use BrickColors.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:32 PM |
What I meant is that you don't do
part.Color3 = Color3.new("New yeller")
you can't use them in bricks. But you can use the color of bricks.
Color3 is a real-valued RGB color tuple, with elements ranging from [0,1]. The Color3 data type is often used in setting the colors of objects that aren't related to bricks, such as GUIs, Sparkles, etc.
I do know that you could use:
TextLabel.BackgroundColor3 = BrickColor.new("New Yeller")
http://wiki.roblox.com/index.php/Color3
~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:36 PM |
You can't do:
TextLabel.BackgroundColor3 = BrickColor.new("New Yeller")
for two reasons.
1) You'd have to use the BackgroundColor property, not the BackgroundColor3, one's for BrickColor, the other Color3 respectively.
2) New yeller is not a valid BrickColor
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:36 PM |
Never mine the second reason, I saw New yeller on the first line.
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
| |
|
|
| 30 Nov 2012 09:47 PM |
Oh xD Didn't know that BackgroundColor3 had to match to Color3 o: and BackgroundColor matches to BrickColor. I'll keep that in mind next time cx
~ṡсɾïρτïṉģ hεlρεɾṡ ۩ lυαlεαɾṉεɾṡ ④ øƒвќṃṿј~ ღ ▂▃▅▆█ρεώḋïερïε☄сυτïερïε█▆▅▃▂ღ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 09:58 PM |
Is there some kind of propert list that shows you all of these properties? Where? How do I apply the color3 to a script to change the color of my base if I set it up where
base=game.Workspace.Base
would I be like base.Color=Color3.new(21) ? (21 is the BrickColorCode for red... I think...)
|
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 10:01 PM |
Like you said, it's the BrickColor code sorta.
base.Color = Color3.new(RedValue, GreenValue, BlueValue)
would be the reference. When you want a red, you'd want more of the red value.
So you'd do:
base.Color = Color3.new(1, 0, 0)
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 10:06 PM |
I see.
base.Color=Color3.new(255, 52, 52)
would (1, 0, 0) still make bright red? or white/black? I would think that (0, 0, 0) made white/black. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 10:13 PM |
1, 0, 0 would be bright red.
0, 0, 0 would make it black; 1, 1, 1 white. (Think 0 has no color, 1 has more)
Also, like Jonah mentioned, the values are from 0 to 1, inclusive. So if the value is higher than 1, like you see in the properties, divide it by 255.
For your example, do:
base.Color=Color3.new(1, 52/255, 52/255)
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2012 10:14 PM |
Actually, 1, 0, 0 would not be bright red. I thought you meant "bright" as really "bright", but it'd probably be "Really red".
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|