|
| 02 Aug 2015 05:46 PM |
I'm trying to figure out how to do this thing where on my Color Changer when I click a different color on the model the Surface Gui Text on the thing to change to the color's name. Example: I clicked neon green and the surface gui text displays "Neon Green"
Anyone know how to do this?
script:
wait(1) for i,v in pairs(script.Parent.Buttons:GetChildren()) do if v:FindFirstChild("ClickDetector") then v.ClickDetector.MouseClick:connect(function() script.Parent.Color.BrickColor = v.BrickColor script.Parent.Parent.Parent.DropColor.Value = v.BrickColor end) end end
I tried doing adding this but didn't seem to work:
script.Parent.Color.BrickColor = script.Parent.Sign.SurfaceGui.TextLabel.Text
- RBXDev Manager and Game Developer. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 05:47 PM |
brick = game.Workspace.Part.BrickColor
print(brick) |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 05:48 PM |
I don't need it printing the color of the brick to the console. I'm talking about where it prints to the Surface Gui like... I clicked neon green and the surface gui text displays "Neon Green" |
|
|
| Report Abuse |
|
|
igunaa
|
  |
| Joined: 15 Sep 2010 |
| Total Posts: 2588 |
|
|
| 02 Aug 2015 05:49 PM |
SurfaceGui.Text = game.Workspace.Part.BrickColor
Said the wise. |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 05:49 PM |
just make a Textlabel in the script(create one in the script) and have the text be = BrickColor using the defining method I showed you |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 05:52 PM |
I changed it to this now I'm getting an error.
wait(1) for i,v in pairs(script.Parent.Buttons:GetChildren()) do if v:FindFirstChild("ClickDetector") then v.ClickDetector.MouseClick:connect(function() script.Parent.Color.BrickColor = v.BrickColor script.Parent.Sign.SurfaceGui.TextLabel.Text = script.Parent.Color.BrickColor end) end end
Error: Workspace.Colorize.ColorizerScript:6: bad argument #3 to 'Text' (string expected, got BrickColor) |
|
|
| Report Abuse |
|
|
| |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
|
| 02 Aug 2015 06:04 PM |
It doesn't have a certain color. It's a color changer where you click diffrent colors and the brick's color changes to the color you clicked.
I just want it to display the colors name they clicked on a surface gui.
- RBXDev Manager and Game Developer. |
|
|
| Report Abuse |
|
|
| |
|
|
| 02 Aug 2015 06:08 PM |
^ it prints an error saying "Name cannot be assigned to"
my line of code: script.Parent.Color.BrickColor.Name = script.Parent.Sign.SurfaceGui.TextLabel.Text |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 06:12 PM |
| oh come on why cant anyone help me |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 06:16 PM |
**facepalm**
You know the basics of scripting right?
script.Parent.Sign.SurfaceGui.TextLabel.Text = script.Parent.Color.BrickColor.Name |
|
|
| Report Abuse |
|
|
|
| 02 Aug 2015 06:18 PM |
Yes im pretty good at it but THANK YOU SO MUCH I OWE U LIFE JK BUT IM SERIOUS THANK YOU SO MUCH IT TOOK OVER 10 POSTS FOR SOMEONE TO FINALLY HELP ME AND CORRECT THIS I THANK YOU oper. |
|
|
| Report Abuse |
|
|