|
| 29 Jun 2017 02:58 PM |
For example, I have a brick that calls a function in a script (the script is inside of the brick) when touched, but the function is as follows:
function changeColor(color) script.Parent.BrickColor = color end
script.Parent.Touched:Connect(changeColor(color))
The problem is that if I put an argument in a function that is called by an event, the script mistakes the argument as an argument that is going to be used by the event, while in reality I simply want the function easy to modify by changing its arguments. Any ideas? |
|
|
| Report Abuse |
|
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
|
| 29 Jun 2017 03:00 PM |
script.Parent.Touched:Connect(function(hit) changeColor(BrickColor.new("Bright red")) end)
|
|
|
| Report Abuse |
|
| |
Wrathsong
|
  |
| Joined: 05 Jul 2012 |
| Total Posts: 22393 |
|
| |