|
| 27 Jun 2014 01:24 AM |
Hello, I am trying to make a thing that will change a brick's color when the brick touches the part. I am kind of a noob to Roblox Lua so please be nice! :3 Current code:
local Part = Game.Workspace.MetalHeater Part.Touched:connect(function(part) local metal = part.Parent:FindFirstChild("BlockMesh") metal.BrickColor = BrickColor.Yellow() end)
I was trying to use BlockMesh as an indicator to tell the script what it should turn yellow and what not to. |
|
|
| Report Abuse |
|
|
| |
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 27 Jun 2014 01:50 AM |
local Part = Game.Workspace.MetalHeater Part.Touched:connect(function(part) MetalHeater.BrickColor = BrickColor.Yellow() end)
I haven't messed around with brick colors, but try that. |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 27 Jun 2014 01:51 AM |
| Also, I don't think you can just change the color of the mesh, because the mesh doesn't have a color value. You would have to use the whole brick. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2014 01:55 AM |
| Hmmm.. Still doesn't work. |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 27 Jun 2014 01:57 AM |
local Part = Game.Workspace.MetalHeater Part.Touched:connect(function(part) Part.BrickColor = BrickColor.Yellow() end)
M'bad, I used MetalHeater and not the local variable Part. |
|
|
| Report Abuse |
|
|
|
| 27 Jun 2014 02:05 AM |
| Well, it almost works. It colors the part that is supposed to color the brick. |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 27 Jun 2014 02:15 AM |
Wait, so where is the brick it's supposed to color?
|
|
|
| Report Abuse |
|
|
|
| 27 Jun 2014 09:57 AM |
| The brick is going to get spawned onto a conveyor belt, then it is going to touch the Metal Heater. |
|
|
| Report Abuse |
|
|
| |
|