Simple Gui script not working

I’m trying to make a GUI disappear once a button is clicked but its not disappearing. I don’t know any other approaches. This was done in a local script.

local button = script.Parent

button.MouseButton1Click:Connect(function()
	button.Parent.Parent = game.ServerStorage
end)

Do you just want to destroy it? Otherwise I’ll do

local button = script.Parent

button.MouseButton1Click:Connect(function()
	button.Parent.Parent:Destroy()
end)

Though make sure you delete it in the server side rather than just the client side

2 Likes

No reason to send it to server storage thats just cluttering it up and can cause gui issues later, just :Destroy() or Debris:AddItem() or just hide it with the Enabled attribute

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.