How to make the other frame disappear when clicking another button

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear
  2. What is the issue? Include screenshots / videos if possible!
    when clicking a button a frame appears but when i click another button a frame appears
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?no

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

  • List item

robloxapp-20230526-1435451.wmv (341.3 KB)
how to make the frame when clicking the other button
plss help me

Hello! You can use MouseButton1Click to check if the button was clicked, then you can use the Visible property on a frame to hide it like so:

local otherFrame=script.Parent.Frame -- Change to the other frame

script.Parent.MouseButton1Click:Connect(function()
    otherFrame.Visible=false
end)

Make sure to put this script inside the button and inside a LocalScript, else it won’t work!
Please let me know if this worked. If it didn’t, let me know and i’ll assist you to the best of my ability.

Something like this:


Might be confusing there’s so many buttons I just want a one localscript

Then you can create a script to detect if a button (with the same name as the frame) was clicked, then hide all the other frames and show the new one.

Can u make the script I’m new I would appreciate it