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 |
|
|
|
| 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
|
  |
| Joined: 17 Dec 2009 |
| Total Posts: 2181 |
|
|
| 02 Jul 2016 06:03 PM |
| Using functions just gives me "expected identifier, got ")"" |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|