Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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?

2 comments

0

just make sure the order is this screen gui frame then a textbutton or text label or text box

0

Any errors in the output?

2 answers

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

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

2 comments

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!

0

I need more information where do you put the GUI. Take a screenshot of ur studio and the GUI's parent.

This discussion is preserved as it was. New answers, comments, and votes are closed.