Jacobmcp
|
  |
| Joined: 26 Dec 2014 |
| Total Posts: 54 |
|
|
| 22 Jun 2017 08:05 PM |
function onClicked(playerWhoClicked) script.Parent.Parent.Parent.Transparency = 1 end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Somebody who can actually script (unlike me) please fix this for me |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2017 08:10 PM |
Your question is too vague; please explain is detail what your trying to do, and what's not working.
Also, have your question title and explanations reflect what you're trying to do. (Why is my [BLANK] not [BLANK]? Code isn't [BLANK] [BLAH]?) |
|
|
| Report Abuse |
|
|
| |
|
Jacobmcp
|
  |
| Joined: 26 Dec 2014 |
| Total Posts: 54 |
|
|
| 22 Jun 2017 08:12 PM |
I want a button Onclicked to change the transparency of a union Union111->Part->ClickDetector->Script |
|
|
| Report Abuse |
|
|
| |
|
Jacobmcp
|
  |
| Joined: 26 Dec 2014 |
| Total Posts: 54 |
|
|
| 22 Jun 2017 08:14 PM |
21:14:47.644 - function onClicked(playerWhoClicked) script.Parent.Parent.Parent.Transparency = .5 end script.Parent.ClickDetector.MouseClick:connect(onClicked):5: attempt to index global 'script' (a nil value) 21:14:47.648 - Stack Begin |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2017 08:15 PM |
| Where is your script at? Try making it a direct child of the union. |
|
|
| Report Abuse |
|
|
Jacobmcp
|
  |
| Joined: 26 Dec 2014 |
| Total Posts: 54 |
|
|
| 22 Jun 2017 08:16 PM |
| A part is inside the union and inside the union is a clickdetector then inside the clickdetector is the script |
|
|
| Report Abuse |
|
|
|
| 22 Jun 2017 08:19 PM |
If the click detector is inside the union, and this script is inside of that, then it looks like you have your hierarchy wrong. Try this.
function onClicked(playerWhoClicked) script.Parent.Parent.Transparency = 1 end
script.Parent.MouseClick:connect(onClicked)
|
|
|
| Report Abuse |
|
|
Jacobmcp
|
  |
| Joined: 26 Dec 2014 |
| Total Posts: 54 |
|
|
| 22 Jun 2017 08:21 PM |
| Ok I had it right I must of spelled something wrong or capitalized something wrong I copied yours and added a parent and now it works, thanks |
|
|
| Report Abuse |
|
|
| |
|
Jacobmcp
|
  |
| Joined: 26 Dec 2014 |
| Total Posts: 54 |
|
|
| 22 Jun 2017 08:25 PM |
| I put .ClickDetector instead of MouseClick |
|
|
| Report Abuse |
|
|