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

Exit button not working! Any help? Not deleting the Frame!

Asked by 8 years ago

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

function exit()
wait(0)
script.Parent.Parent:Destroy()
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? It is in a model, and it apears when trigered, that part works fine, and it does work on studio mode, i can never get it to work :/

1 answer

Log in to vote
-1
Answered by 8 years ago

Without seeing the GUI itself I cannot tell, but try this (just a rewrite of the code so it looks neater, may fix it, I'm not sure to be honest. You probably have a problem with parents or something):

script.Parent.MouseButton1Click:connect(function()
    script.Parent:remove()
end)

Hope it works, if not, I can't help you there - sorry!

Ad

Answer this question