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: How would I make a part mimic another part?

Previous Thread :: Next Thread 
Meowth552 is online. Meowth552
Joined: 17 Dec 2009
Total Posts: 2181
02 Jul 2016 05:51 PM
Example:

Part1 changes colour due to Button1 being pressed.

When either Button1 or Button2 are pressed, the colour on both Part1 and Part 2 should change.

How would I achieve this?
Report Abuse
CyberNugget is not online. CyberNugget
Joined: 04 Dec 2011
Total Posts: 568
02 Jul 2016 05:54 PM
Call a generic function each time one of the button events are triggered. I guess you could use something like:

Button.OnPressed:connect(function()
GenericFunction()
end)


Report Abuse
Meowth552 is online. Meowth552
Joined: 17 Dec 2009
Total Posts: 2181
02 Jul 2016 06:03 PM
Using functions just gives me "expected identifier, got ")""
Report Abuse
Meowth552 is online. Meowth552
Joined: 17 Dec 2009
Total Posts: 2181
02 Jul 2016 06:05 PM
Do I have to copy and paste a bunch of i,v in pairs all over my script for it to work?
Report Abuse
CyberNugget is not online. CyberNugget
Joined: 04 Dec 2011
Total Posts: 568
02 Jul 2016 06:10 PM
It's late but I want to help you man lol. I don't think you'd have to go to that extent, but I'm sure there's an easier way to do it. You seem quite knowledgeable so give it a try and see if it works. Otherwise, we can work on that error together if it's causing problems.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 Jul 2016 06:45 PM
--part1

script.Parent.ClickDetector.MouseClick:connect(function()
script.Parent.BrickColor = BrickColor.new("White")
workspace.Part2 = BrickColor.new(script.Parent.Brickcolor)
end)

--part2

script.Parent.ClickDetector.MouseClick:connect(function()
script.Parent.BrickColor = BrickColor.new("Black")
workspace.Part1 = BrickColor.new(script.Parent.Brickcolor)
end)


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