Roboguy51
|
  |
| Joined: 26 Feb 2011 |
| Total Posts: 35 |
|
|
| 01 Jan 2014 11:31 AM |
I wrote a script and put it in a textbutton: local function onClicked() script.Parent.Parent.TextLabel.TextLabel2:destroy () script.Parent:destroy () end script.Parent.MouseButton1Click:connect(OnClicked) It doesnt work for some reason D: Why? |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 11:31 AM |
not great at scripting but I think Destroy is supposed to have a capital letter.
#nerdsunited |
|
|
| Report Abuse |
|
|
Roboguy51
|
  |
| Joined: 26 Feb 2011 |
| Total Posts: 35 |
|
| |
|
Roboguy51
|
  |
| Joined: 26 Feb 2011 |
| Total Posts: 35 |
|
| |
|
|
| 01 Jan 2014 11:37 AM |
function onClicked() script.Parent.Parent.TextLabel.TextLabel2:remove() script.Parent:remove() end script.Parent.MouseButton1Down:connect(OnClicked) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 11:40 AM |
Theres a spacebar at destroy
its not ':destroy ()' its ':destroy(); |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 01 Jan 2014 11:43 AM |
Do not do what secet did. Ever..
EEVVEERR. :remove() is old and glitchy,
Use
:Destroy()
|
|
|
| Report Abuse |
|
|
Roboguy51
|
  |
| Joined: 26 Feb 2011 |
| Total Posts: 35 |
|
|
| 01 Jan 2014 11:43 AM |
Didnt work, output says: attempt to call a nil value Disconnected event because of exception |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 01 Jan 2014 11:45 AM |
function onClicked() script.Parent.Parent.TextLabel.TextLabel2:Destroy() script.Parent:Destroy() end script.Parent.MouseButton1Click:connect(OnClicked)
That has more chance of succeeding. |
|
|
| Report Abuse |
|
|
Roboguy51
|
  |
| Joined: 26 Feb 2011 |
| Total Posts: 35 |
|
| |
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 01 Jan 2014 12:08 PM |
| Gives us everything in the enire output. Copy and paste. |
|
|
| Report Abuse |
|
|
Roboguy51
|
  |
| Joined: 26 Feb 2011 |
| Total Posts: 35 |
|
|
| 01 Jan 2014 12:18 PM |
| Got it to work now, on the last line when i put (OnClicked) it wasnt supposed to be a capital "O" :| |
|
|
| Report Abuse |
|
|