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

Gui's Open More Than Once?

So I know that title makes no sense so let me explain, I had a question already answered by user (DragonSpawner12). There's one more thing though, he/she showed me how to make my gui go off the screen after a certain amount of time, but you can keep clicking it over and over and it breaks it to where it just stays on screen. I also want it where you can only click it once. Here's the script. (I also had to repost this because no one answered my last one).


function onClick(click)

for i,v in pairs (script.Parent:GetChildren()) do

if v.ClassName == "ScreenGui" then

c = v:Clone()

c.Parent = click.PlayerGui

wait(3)

c:Destroy()

end

end

end

script.Parent.ClickDetector.MouseClick:connect(onClick)

1 comment

0

I don't know how make the code right so, I'm sorry for that

1 answer

Hi! So if you want Gui's more than twice you need to have a debounce set up let me show you an example

local Button = script.Parent.TextButton
local Open = false




Button.MouseButton1Click:Connect(function()
	if not Open then
		print('Not Open')
               -- Close your Gui here
	else
		print('Open')
               -- Open it here
	end
	Open = not Open
end)

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