I have just made a script that when I click on an object a gui pops up. I can open it once and then close it but after I close it that first time it doesn't let me open it again. My opening code is
local gui = script.Gui local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked
brickClickedEvent.OnClientEvent:Connect(function() gui.Enabled = true
end)
My button close script is
function close() script.Parent.Parent.Visible = false end
script.Parent.MouseButton1Click:connect(close)
What should I do to fix this?
You're switching between the usage of Enabled
and Visible
, you have to use one out of the two, don't combine them.