|
| 01 Aug 2012 08:59 AM |
I was using a FMed one but none of those work. I want the GUI Button/Script to close the GUI for good so if someone resets they don't see it again. But before I do that I want a script that atleast closes my GUI. But could someone do that for me? Anyway, Here is the script I'm using:
print("Close button loaded")
button = script.Parent window = script.Parent.Parent
function onClicked(GUI) window:remove() end script.Parent.MouseButton1Click:connect(onClicked)
Its not working for some reason. I hope this makes sense. Your Help would be helpful. ~Flyacesnoopy
|
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 09:17 AM |
button = script.Parent window = script.Parent.Parent
function onClicked() window:Destroy() end script.Parent.MouseButton1Click:connect(onClicked)
If you dont need GUI, then dont use it. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 10:22 AM |
If I wanted to get rid of all of the GUIs would I do:
window = script.Parent.Parent.Parent.Children
Yes I know I added another Parent.. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 10:49 AM |
Also, I want the GUI to only open when you enter the game... So may I have some help? |
|
|
| Report Abuse |
|
|
Colt324
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 1562 |
|
|
| 01 Aug 2012 10:54 AM |
| clone the gui from a cache (lighting) using the .ChildAdded event |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 11:07 AM |
Sorry, I don't get what you mean... :3 |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 11:15 AM |
Do you want to destroy the GUI, or make in invisible? Because then it would be TheGUI.Visible = false |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 11:23 AM |
For people joining the game, you could put the GUI in lighting, and then when the event PlayerAdded happens, it parents the GUI into the person's PlayerGui.
PlayerAdded: wiki.roblox.com/index.php/PlayerAdded
Then, for the event on the GUI, use MouseButton1Down
MouseButton1Down: http://wiki.roblox.com/index.php/MouseButton1Down_(Event) |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 11:25 AM |
Use Destroy() with a capital D, I don't think remove works lower case.
Destroy: http://wiki.roblox.com/index.php/Destroy_(Method) |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2012 01:14 PM |
So it would be something like:
game.Players.PlayerAdded:connect(function(player) --Then I would have to move it. (Not sure how to do that.) But it is multiple GUIs By the way.
gui.MouseButton1Down:connect(function() Destory() end
|
|
|
| Report Abuse |
|
|