Is it possible to make a image button disappear after you click a text button within the same script where the text button gets destroyed itself?

  1. What do you want to achieve?
    I want to image, other buttons to disappear, since it doesn’t look good, when I press a certain button, but it doesn’t destroy the image/text buttons.
  2. What is the issue?
    I’m trying to make this script:
    script.Parent.MouseButton1Click:connect(function()

script.Parent:Destroy()

script:Destroy(ImageButton)

end)

And of course, the ImageButton in brackets gets underlined, why?

  1. What solutions have you tried so far?
    I didn’t saw any posts about this on DevForums.
1 Like

I’m not really the best scripter, but it seems like the end line just says to destroy “ImageButton”, and doesn’t elaborate on where to find it.

Hmm, I tried this, but it doesn’t work:
script.Parent.MouseButton1Click:connect(function()

script.Parent.MouseButton1Click:connect(function()

script.Parent:Destroy()

script.StarterGui.ScreenGui.ImageButton:Destroy()

end)

Yeah that makes sense if you destroy the parent the children get destroyed as well duh why didn’t I notice that.

I meant I’m making a FNaF game on roblox, I have been making it on other engines, but decided that I would like to make it on roblox, so I wanted to make a camera system, which when you click a text button, the map dissapears.

1 Like

Not on Roblox no, sorry, but I only accept friend requests from people I know. I ignored it.

What I meant is when you click this button:


The map dissappears:
image

i think if he uses it so the visibility would be changed and the image will not be changed in my opinion…

Maybe it is a problem with the placement of the script?
image

When I click the map, it destroys itself, but i only want it to be destroyed when the BackButton is clicked.

Yes, it is the map, which is in ScreenGui.

[ Content Deleted ]
[ Content Deleted ]
[ Content Deleted ]

2 Likes

Thank you, it works really well. Also one question, how to make a button and a map appear when you press a button?