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: Changing a brick's color when it touches a part

Previous Thread :: Next Thread 
Kirby27356 is not online. Kirby27356
Joined: 24 Jan 2011
Total Posts: 29
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
Kirby27356 is not online. Kirby27356
Joined: 24 Jan 2011
Total Posts: 29
27 Jun 2014 01:47 AM
Anyone?
Report Abuse
Krosskode is not online. 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 is not online. 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
Kirby27356 is not online. Kirby27356
Joined: 24 Jan 2011
Total Posts: 29
27 Jun 2014 01:55 AM
Hmmm.. Still doesn't work.
Report Abuse
Krosskode is not online. 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
Kirby27356 is not online. Kirby27356
Joined: 24 Jan 2011
Total Posts: 29
27 Jun 2014 02:05 AM
Well, it almost works. It colors the part that is supposed to color the brick.
Report Abuse
Krosskode is not online. 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
Kirby27356 is not online. Kirby27356
Joined: 24 Jan 2011
Total Posts: 29
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
Kirby27356 is not online. Kirby27356
Joined: 24 Jan 2011
Total Posts: 29
27 Jun 2014 10:26 AM
Ok, nevermind. I got it.
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