|
| 26 Jul 2012 05:17 PM |
TextButton = script.Parent TeleportGui = script.Parent.Parent
function onClicked(TextButton) TeleportGui:remove() end script.Parent.MouseButton1Click:connect(onClicked)
When I click the button it doesn't remove, it just stayed there. I'm pretty sure i named the things correctly like "TextButton" etc. Would someone mind helping me? |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:20 PM |
The script should work, what is script.Parent.Parent?
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:21 PM |
| Oops, lemme try deleting one parent and test it again. |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jul 2012 05:23 PM |
Again what are you trying to remove, and what is its path (script.Parent, script.Parent.Parent, etc)?
† KMXD † |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
| |
|
|
| 26 Jul 2012 05:28 PM |
| I'm trying to remove the buttons, theres gonna be five buttons that say colors of animals and when you click one they remove themselves, the script.parent thing is to tell the computer that the script is in the gui model, not the button |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:30 PM |
the output says this when i click it MouseButton1Click is not a valid member of ScreenGui |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 26 Jul 2012 05:31 PM |
| Then you need to change your parents in the connection line. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:33 PM |
| ok...Does that mean i need to but it in the TextButton? |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:35 PM |
What are you trying to remove the button itself, or the whole GUI? If the latter, how many parents is it until it reaches the GUI?
† KMXD † |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 26 Jul 2012 05:35 PM |
| The script? Yeah, then if it still doesn't work, show me the output again. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:37 PM |
| I remember reading something this person posted and they said you need to use 2 ends, should i do that? on the second last line |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:37 PM |
You only need one, for the function.
† KMXD † |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 26 Jul 2012 05:37 PM |
| No. The problem is not the amount of ends. The problem is exactly what the output says, which implies you either need to move the script or change the amount of parents. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:38 PM |
| Im trying to remove the buttons then wait a certain amount of time and have the gui remove its self, like the whole gui |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:38 PM |
| im going to try to move the script to the button first |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:39 PM |
...Yes the script needs to be in the button.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:41 PM |
| I moved the script and the button removes its self, when i add the four other buttons will it remove those as well? |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:41 PM |
Not unless you remove the whole GUI, or each individually.
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:43 PM |
| i just want it to remove the buttons when you click it and have a white background for a certain period of time (which i may also need help on) and then have the whole gui remove its self |
|
|
| Report Abuse |
|
|
filj
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 72 |
|
|
| 26 Jul 2012 05:43 PM |
| It's a .MouseButton1Click script, NOT an onClick script. |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 05:44 PM |
| thanks for the info filj, ill remember that |
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
| |
|
|
| 26 Jul 2012 05:46 PM |
Try:
TextButton = script.Parent function onClicked(TextButton) for i, v in pairs(TextButton.Parent:GetChildren()) do if v:IsA("TextButton") then v:Destroy() end end end TextButton.MouseButton1Click:connect(onClicked)
† KMXD † |
|
|
| Report Abuse |
|
|