|
| 21 Jan 2017 12:09 PM |
I have recently gotten back into scripting after a couple years and I kind of forget how to script. I made a pop up gui and whenever I test it (e.g when I hit the button) the gui disappears, (which I want, and when I reset, the gui doesn't come back which I want) but so does the roblox chat and I am unable to chat sadly. So how can I fix this?
Script: print("Close button loaded")
button = script.Parent window = script.Parent.Parent.Parent.Parent
function onClicked(GUI) window:remove() end script.Parent.MouseButton1Click:connect(onClicked) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
JameulA
|
  |
| Joined: 07 Apr 2016 |
| Total Posts: 66 |
|
|
| 22 Jan 2017 04:38 AM |
Im assuming that button is your 'Toggle' and window is your frame in the explorer if it isn't then please specify.
This should work:
print ("Close Button has Loaded")
local button = script.Parent local window = script.Parent.Parent.Parent.Parent.Parent.:WaitForChild('[NAME]') --
button.MouseButton1Click:Connect(function() window.Visible = not window.Visible end
--You're welcome!
|
|
|
| Report Abuse |
|
|
|
| 22 Jan 2017 08:59 AM |
| I had this from a while ago and I recently got back into scripting so I don't know. I am just trying to figure out how to script an "okay" button (for like if I say the rules at a fort, then hit ok if you accept them) and whenever I try doing it, it either makes the chat disappear permanently as well as the gui, or it makes it so the gui only gets removed and appears after respawn. |
|
|
| Report Abuse |
|
|
JameulA
|
  |
| Joined: 07 Apr 2016 |
| Total Posts: 66 |
|
|
| 23 Jan 2017 11:25 AM |
If you would like it to be removed forever upon being clicked you would use Destroy() function,if not and you would like it to be able to respawn after death.Go to Frame or ScreenGui and click the box in properties that says something like 'Show when dead' can't remember the exact words but it should be like that and for the script:
local button = script.Parent
function Show() script.Parent.Parent.Visible = false
button.Mousebutton1Click:Connect.function(Show)
--Remember to change the frame's variables so that it shows.
--or if you Tl;DR watch this video
https://www.youtube.com/watch?v=qpxVRGLPXnA
--You should know most of these stuff + instead of '.Visible = true' you could use :Destroy()
--The chat thing i have no idea prob have InterfaceRemove script like this
--http://wiki.roblox.com/index.php?title=Disabling_parts_of_the_game_interface |
|
|
| Report Abuse |
|
|