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

How to stop buttons underneath popup GUI from being clicked?

NO incapaz my question isn't "Too broad". But this time I will be a little more specific anyway. So all I need to know is how I can make it where you can't click a button when a gui is overlapping it. Simple. So, i have a few ideas, I just want to know if there are any better methods I can use.

  1. creating another button to counteract the other buttons
  2. making everything else invisible
  3. making an if statement and "if" my popup is activated they won't do anything when clicked So are there any other ways? If you are still confused, just look at this GIF and you will see what I am talking about: https://gyazo.com/62fd926a823c86c50d073403f2cdbe38

7 comments

0

Can't you post a picture of what it looks like, or even better, a gif. Yes your question is too broad or else it wouldn't be closed.

0

ok thank you. I will post my problem in a visualized way

0

Hello? Incapaz? Help?

0

Set the Active property to false on the button when you dont want it to be clickable.

0

i did that and it failed

0

what about checking if the clicked ui's Zindex value is lower than the currently visible ui

0

Someone else already helped me early today at about 3:00 UTC-5

1 answer

I had this issue once. I hope this works for you. Try setting the other text buttons "Selectable" options to false when something is clicked. Like so,

local Tfirst = script.Parent.TextButton1
local Tsecond = script.Parent.TextButton2 -- The name of the actual text button goes here.
local frame = script.Parent.Frame --Assume that the frame covers the entire screen.
local debounce = false
--These are made up, just assume that these are your buttons.
Tfirst.MouseButton1Click:Connect(function)
    if debounce == false then
	    Tsecond.Selectable = false
	    Tsecond.Visible = false
	    frame.Visible = true
	    wait(0.5) --This wait isn't really needed, but I put it there to give the person some cooldown time to prevent spam.
	    debounce = true
	elseif debounce == true then
		Tsecond.Selectable = true
		Tsecond.Visible = true
		frame.Visible = false
		wait(0.5)
		debounce = false
	end

Now there are other ways to solving this, but this is my method of doing this. Hopefully it works for you.

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