Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Why is this Exit Button not working? Its not functioning properly (NOT ANSWERED)

Asked by 8 years ago
Edited 8 years ago

so..... this exit gui that i made is not working, here is the script!

function exit()
wait(0)
script.Parent.Parent:remove()
end
script.Parent.MouseButton1Down:connect(exit)

The First parent is the Exit, and the second is the frame, shouldi change it to the Shop Gui Itself? I dont know...... can anyone help?

0
just make sure the order is this screen gui frame then a textbutton or text label or text box johndeer2233 439 — 8y
0
Any errors in the output? M39a9am3R 3210 — 8y

2 answers

Log in to vote
1
Answered by 8 years ago

First of all they don't use the :remove() event anymore its :Destroy() that may be the issue try that

Ad
Log in to vote
1
Answered by
Bulvyte 388 Moderation Voter
8 years ago
Edited 8 years ago

If the script.Parent.Parent is Frame u need it to be ScreenGui so the script would remove the ScreenGui not the Frame.

Also use Destroy:()

local main = script.Parent.Parent.Parent --We name the main as "script.Parent.Parent.Parent"

script.Parent.MouseButton1Click:conenct(function() -- A function that waits for user to be clicked.
wait(0)
main:Destroy() --Use Destroy() instead of remove()
end)

This how it would look: http://prntscr.com/c6js0e There are 3 parents. the last parent is the screengui.

OH, and use a LocalScript.

If i helped it would be nice if you accept the answer button :3

0
Unfortunatly, None of the Answers Worked! Is it any different that the Gui is in a model? When i ONLY changed the destroy part, from Remove to destroy, it worked in Studio, but not in player! varunverma 15 — 8y
0
I need more information where do you put the GUI. Take a screenshot of ur studio and the GUI's parent. Bulvyte 388 — 8y

Answer this question