Gui not showing up when pressing a button

im trying to make a donation button and i want to make it so it opens a big donation frame i typed out the script and it has no errors and i see not errors related to the script in the console
this is the script:

is there any thing wrong with it? because it does not work i even have the proper layout

Where is the script located? Your image is a little blurry, mind sending it by text instead?

here you go:

local dbutton = script.Parent

local mainDframe = script.Parent.Parent

dbutton.MouseButton1Up:Connect(function()

mainDframe.Visible = true

end)

--end of script

and here is where the script is located (idk how to show it without a screenshot sorry if its blurry)

image
and when im playing it i set the donation background visibility unchecked

MouseButton1Up fires when the user stops clicking with their mouse. Instead use MouseButton1Down.

local dbutton = script.Parent
local mainDframe = script.Parent.Parent

dbutton.MouseButton1Down:Connect(function()
    mainDframe.Visible = true
end)

Edit: The gui is not even visible for the button to be visible…

1 Like

Why don’t you use dbutton.MouseButton1Click:Connect(function() instead?

i tried MouseButton1Down @SiebeYolo said MouseButton1Click i did that and they are not working for me

Place the Button elsewhere in the ScreenGui just not inside the Frame that will change it’s Visible property also remember to reference properly when that is done.

1 Like

Have you checked the variables you’ve set. I’m assuming you placed the script inside the Donation Button.

And based on the image you’ve given wouldn’t the main Frame be.

this

local mainFrame = script.Parent.Parent.donationmaineFrame

instead of

lcoal mainFrame = script.Parent.Parent

Sorry If I’m wrong.

1 Like

i tried that but i also wrote

print(“working”) in the function too, to see if the function works i pressed the button and it did not print it out

This is the layout

Layout

Here’s the Output

Output

Here’s my Code

Code

I tested it and the Frame became visible.

Have you checked your variables, and the location of the different UI elements ?

will try that out, right now im kind of tired cause i just finished the UI on my other game

1 Like

i solved it myself the scripts were broken so i deleted them and did it again

still thank you for helping me

1 Like