caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
|
| 07 Aug 2011 10:13 PM |
Ok So I made a button and a door In one model And Put this script in the button...
fuction Onclicked() wait(0.5) script.Parent.Bob.CanCollide = False script.Parent.Bob.Transparency = 1 end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Whats Wrong with it? |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2011 10:14 PM |
The name of the function is 'Onclicked', but in the connection line, you're saying that you want a function named 'onClicked' to fire. These two are not the same, and they should be.
[Insert squiggles here][Say something humorous here][More squiggles go here] |
|
|
| Report Abuse |
|
|
|
| 07 Aug 2011 10:15 PM |
fuction onClicked() wait(0.5) script.Parent.Bob.CanCollide = false script.Parent.Bob.Transparency = 1 end script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
| |
|
scrat101
|
  |
| Joined: 26 Jan 2009 |
| Total Posts: 331 |
|
|
| 07 Aug 2011 10:17 PM |
| for one, the word function is misspelled. Second, the function name you put in the connection is wrong, capitalize the first letter in the function name in the connection. Then, you should be set as long as there is a ClickDetector in the parent of the script. :D :D :D |
|
|
| Report Abuse |
|
|
buster925
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 322 |
|
|
| 07 Aug 2011 10:18 PM |
1. Function is spelled wrong 2. Onclicked is actually onClicked 3.on the last line put script.Parent.ClickDetector.Button1Clicked:connect(onClicked)
hope i helped:) |
|
|
| Report Abuse |
|
|
buster925
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 322 |
|
|
| 07 Aug 2011 10:19 PM |
| wait sorry im late posts came so fast :o |
|
|
| Report Abuse |
|
|
caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
| |
|
buster925
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 322 |
|
| |
|
caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
|
| 07 Aug 2011 10:24 PM |
at the end i already have
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
buster925
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 322 |
|
|
| 07 Aug 2011 10:25 PM |
Oh i got it! ------------------------------ function onButton1Clicked(onClicked) script.Parent.CanCollide = false script.Parent.Transparency = 1 end script.Parent.ClickDetector.Button1Clicked(onClicked) |
|
|
| Report Abuse |
|
|
caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
|
| 07 Aug 2011 10:29 PM |
| That wont work Because The parent is the button |
|
|
| Report Abuse |
|
|
ShoeBox4
|
  |
| Joined: 06 Apr 2011 |
| Total Posts: 890 |
|
|
| 07 Aug 2011 10:31 PM |
@buster925
Isn't the last line supposed to be script.Parent.ClickDetector.MouseButton1Down:connect(onClicked) |
|
|
| Report Abuse |
|
|
buster925
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 322 |
|
|
| 07 Aug 2011 10:32 PM |
| oh i forgot the connect thanks |
|
|
| Report Abuse |
|
|
caca22
|
  |
| Joined: 31 May 2008 |
| Total Posts: 96 |
|
| |
|
buster925
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 322 |
|
|
| 07 Aug 2011 10:37 PM |
ok, try this. ------------------------------------------------------ function onButton1Clicked(onClicked) script.Parent.CanCollide = false script.Parent.Transparency = 1 end script.Parent.ClickDetector.Button1Clicked:connect(onClicked) |
|
|
| Report Abuse |
|
|