#Reveal 'Background' Shop Frame on Left-Side Shop Button Press

18 messages · Page 1 of 1 (latest)

strong crow
#

not sure exactly what the issue is, but to make sure the "BackGround" becomes visible I'd add an extra "BackGrnd.Visible = true" BackGrnd being the variable leading to the frame BackGround

#

Are you asking for the code to make just the BackGround to appear when the button is clicked or all of the gui to appear?

plush turret
#

I ask that all the interface that is contained in the background be visible but when I try to write a program by myself I put it wrong and it does not matter could you write the script or tell me how I can could solve the problem?

strong crow
#

Ill try give me a minute 👍

#

Almost done just testing 🙂

#

k I got something that should work

plush turret
strong crow
#

I set up a setup like in your screenshot above and added some example ui elements in the BackGround to resemble the ones you have.

#

Here is the script I wrote:

local button = script.Parent
local gui = script.Parent.Parent.Parent:WaitForChild("ShopGUI"):WaitForChild("BackGround")

function toggleUIvisibility()
    -- Iterate through all of the descendant UI elements of the uiElement.
    gui.Visible = not gui.Visible
    for _, descendant in ipairs(gui:GetDescendants()) do

        -- If the descendant is a UI element, toggle its visibility.
        if descendant:IsA("UIObject") then
            descendant.Visible = not descendant.Visible
        end
    end
end

button.MouseButton1Click:Connect(toggleUIvisibility)

The button is of course the button and gui is the background gui.

strong crow
#

lemme know if this works for you

plush turret
#

I'll try

plush turret
strong crow
plush turret
#

no, no, that's the problem. send us roblox username so i can add you

strong crow
#

1tybaker

crystal emberBOT
#

studio** You are now Level 4! **studio

strong crow
#

whats urs?