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

How to stop buttons underneath popup GUI from being clicked?

Asked by 5 years ago
Edited 5 years ago

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

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. User#24403 69 — 5y
0
ok thank you. I will post my problem in a visualized way RetroGalacticGamer 331 — 5y
0
Hello? Incapaz? Help? RetroGalacticGamer 331 — 5y
0
Set the Active property to false on the button when you dont want it to be clickable. RubenKan 3615 — 5y
View all comments (3 more)
0
i did that and it failed RetroGalacticGamer 331 — 5y
0
what about checking if the clicked ui's Zindex value is lower than the currently visible ui starmaq 1290 — 5y
0
Someone else already helped me early today at about 3:00 UTC-5 RetroGalacticGamer 331 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

Ad

Answer this question