|
| 03 Feb 2014 05:00 PM |
I keep getting an error saying that there is an unexpected symbol in line 3 near "."
Here it is;
part = game.Workspace.Part
local part.Touched:connect(function() Workspace.Part.BrickColor = BrickColor.new('Teal') if Workspace.Part.BrickColor = ('Teal') then Workspace.Part.Touched:connect(function() Workspace.Part.BrickColor = BrickColor.new('Really red') end end end) |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 05:02 PM |
| You forgot a ')' after function() |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Feb 2014 05:03 PM |
| What about the second function? |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 05:04 PM |
| I think it's that you have to use two equal signs in if statements |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 05:04 PM |
| Oh. :/ Then what's wrong. D: |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 05:05 PM |
| It's only saying there is an error in line 3. |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 05:05 PM |
| You need to use two equals when asking if something equals something else. One equal is to set something equal to something. |
|
|
| Report Abuse |
|
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 03 Feb 2014 05:11 PM |
@People who didn't see all the errors, stop 'helping'.
This doesn't really make any sense. You're setting a parts Color, then asking if that part is the color you just set, then if it is, set it to red. |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 05:16 PM |
| Sorry, sorta my first script. I'm trying to make a script where each time you touch the brick, it's color changes. |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 03 Feb 2014 05:21 PM |
local part = game.Workspace.Part local db = true
part.Touched:connect(function(hit) if hit.Parent and game.Players:findFirstChild(hit.Parent.Name) and db then db = false if part.BrickColor == BrickColor.new("Teal") then part.BrickColor = BrickColor.new("Really red") else part.BrickColor = BrickColor.new("Teal") end wait() db = true end end) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 03 Feb 2014 05:26 PM |
It's a debounce, it keeps the script from running a bunch of times when you touch the brick.
http://wiki.roblox.com/index.php/Debounce |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Feb 2014 07:38 PM |
| Instead of individually naming colors, could I just make it random? |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 03 Feb 2014 07:39 PM |
Yup
BrickColor = BrickColor.new(math.random(),math.random(),math.random())
I think there's an easier way but I don't know it. |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 03 Feb 2014 08:16 PM |
| BrickColor = BrickColor.random() |
|
|
| Report Abuse |
|
|
domorox17
|
  |
| Joined: 06 Mar 2012 |
| Total Posts: 1710 |
|
|
| 03 Feb 2014 08:19 PM |
| @dodle not a Color3 a brickcolor. Yours would also only be capable of creating white. You must divide each value by 255 for a random Color3. |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 03 Feb 2014 08:23 PM |
| LOL did you even test mine? It works perfectly :) no need for division or any of that crap. |
|
|
| Report Abuse |
|
|
|
| 03 Feb 2014 08:27 PM |
| I thought you could only use 64 of the 16,581,375 possible combinations using Color3 as a BrickColor? (In online mode, that is, and without meshes). |
|
|
| Report Abuse |
|
|
dodleman
|
  |
| Joined: 22 Dec 2007 |
| Total Posts: 1118 |
|
|
| 03 Feb 2014 09:04 PM |
Someone did some math.
BrickColors have their own color3 value (BrickColor.Color I think). |
|
|
| Report Abuse |
|
|
|
| 05 Feb 2014 06:33 AM |
BrickColor.Color is actually how I get the RGB for when I'm making textures, LOL
But last time I checked, any of the Color3 combinations other than the 64 on the color palate wouldn't show up in online mode.
And again, that is without decals, textures, and/or meshes. |
|
|
| Report Abuse |
|
|
Truste135
|
  |
| Joined: 26 Oct 2010 |
| Total Posts: 741 |
|
|
| 05 Feb 2014 06:43 AM |
The color3.new(math.random(), math.random(), math.random()) works. I used it myself in my build tool, so don't go around talking crazy stuff as that doesn't work.
i'm not crazy just ask my toaster |
|
|
| Report Abuse |
|
|