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

Why doesn't my gui re-open when I click on it again?

Asked by 4 years ago

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?

0
When you click on a ClickDetector or a Signal like "Part.Touched:Connect" NiniBlackJackQc 1562 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

You're switching between the usage of Enabled and Visible, you have to use one out of the two, don't combine them.

Ad

Answer this question