Scripted UI wont open

My imagebutton and I tried textbutton to and it wont open my ui.image

At this point if this is a roblox Friday the 13th joke its not funny and it annoys us developers.

Ok this is closed error was my background image was colliding with the buttons.

Hmm, let me see if I can find something,
ah you connected it to a function.

No need just do

function onclick(clicked)
    if frame.Visible == false then
        frame.Visible = True
    else
        frame.Visible = false
end
end

script.Parent.Parent.Menu.MouseButton1Click:Connect(function()

That’s the same thing.,

And testing it, and you are missing code to that

It is a localscript, I suggest looking closer at the scripts.

Yes, put it directly in StarterGui that might help.

Dude, look at the screenshots its in the GUI, You seem new. Again I highly advise look at the screenshots before replying to a subject thats been already done in the screenshot/post.
image

Your not understanding what I’m saying, put the script in STARTERGUI not the gui itself.

And then change the variables and stuff, then it should work. Tell me if it works or not!

Tested this and it failed, It should work both ways.

image

Weird, I got nothing to tell you man, I wish I could help I really do, I did with mine it’s weird it won’t work. But I’m going to go to bed, I’m pretty tired goodnight!

It’s because you’re not referencing the right things. I’m assuming your script is the LocalScript parented to Frame in the screenshot. In your second line in your original post, you are trying to get MenuFrame from StarterGui when it is actually under GameUI. Use this for your second line instead:

local frame = script.Parent.Parent.MenuFrame

It also happens in the first line.

Complete function:


local frame = script.Parent.Parent.MenuFrame
script.Parent.MouseButton1Click:Connect(function()
    if frame.Visible == false then
        frame.Visible = true
    else
        frame.Visible = false
    end
end)
1 Like

Few things wrong with that script , You forgot a ) at the laat end. Other then that, Thats my exact script.

Im not getting it from starter to, Its script.Parent. My script was correct roblox is being buggy.

And I suggest revoew the code.

It’s not. Look more carefully at the variable declarations.

Just use this

local Sp = script.Parent
local Main = Sp.Parent
local MenuFrame = Main.Parent.MenuFrame

Sp.MouseButton1Down:Connect(function()
	MenuFrame.Visible = not MenuFrame.Visible
end)
2 Likes