generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Close GUI Script not working

Previous Thread :: Next Thread 
flyacesnoopy is not online. flyacesnoopy
Joined: 25 Aug 2010
Total Posts: 1736
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
1518NICENICKEY is not online. 1518NICENICKEY
Joined: 29 Apr 2009
Total Posts: 1136
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
flyacesnoopy is not online. flyacesnoopy
Joined: 25 Aug 2010
Total Posts: 1736
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
flyacesnoopy is not online. flyacesnoopy
Joined: 25 Aug 2010
Total Posts: 1736
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 is not online. 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
flyacesnoopy is not online. flyacesnoopy
Joined: 25 Aug 2010
Total Posts: 1736
01 Aug 2012 11:07 AM
Sorry, I don't get what you mean...
:3
Report Abuse
TrueSoulWolf is not online. TrueSoulWolf
Joined: 02 Apr 2011
Total Posts: 460
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
TrueSoulWolf is not online. TrueSoulWolf
Joined: 02 Apr 2011
Total Posts: 460
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
TrueSoulWolf is not online. TrueSoulWolf
Joined: 02 Apr 2011
Total Posts: 460
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
flyacesnoopy is not online. flyacesnoopy
Joined: 25 Aug 2010
Total Posts: 1736
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image