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 » Scripters
Home Search
 

Re: Detect Brick's Color, use it to Change Other Brick's Color?

Previous Thread :: Next Thread 
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
05 Jun 2016 08:43 AM
function colorChange(hit)
color.BrickColor = BrickColor.new(hit.BrickColor)
end

color.Touched:connect(colorChange)

My example. The Last part is the area that I get an error for. Help please?
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
05 Jun 2016 08:46 AM
You don't need to put hit.BrickColor in a BrickColor constructor because it already is a BrickColor.
Report Abuse
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
05 Jun 2016 08:48 AM
But without the hit part, it's just saying BrickColor randomly, which is neither a string, a number or a value. It's just like saying 'tree' randomly. The machine won't know what to do.
Report Abuse
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
05 Jun 2016 08:49 AM
"(Color3 expected, got table)"
Report Abuse
BlupoV2 is not online. BlupoV2
Joined: 12 Nov 2012
Total Posts: 543
05 Jun 2016 08:50 AM
color.BrickColor = hit.BrickColor
Report Abuse
OnlineOne is not online. OnlineOne
Joined: 14 Jul 2011
Total Posts: 1193
05 Jun 2016 08:54 AM
There, I figured it out. It had to be a string.

color.BrickColor = BrickColor.new(tostring(hit.BrickColor))

This works. Thanks for the effort.
Report Abuse
zekey101 is not online. zekey101
Joined: 08 Aug 2011
Total Posts: 2499
05 Jun 2016 08:55 AM
alright put this in the brick
color = other brick
script.Parent.Touched:connect(function(hit)
if hit.Parent.Name == "Whatever the name is" then
color.BrickColor = hit.BrickColor
end
end)

that should work


https://www.roblox.com/games/420326453/End-of-the-Line-v7-2a
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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