Having trouble removing gui from playerGui. What am I doing wrong?

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

  1. What do you want to achieve?

I am trying to remove all guis that are in the a player’sGui while keeping some important ones left alone, but for some reason the script deletes all of them.

  1. What is the issue? Include screenshots / videos if possible!
    The script deletes every gui even though I want a select few to remain

image

image
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I know that if I just try to find just one of them(In this scenario I’ll be looking to see if the gui name is not the same as “Freecam”) it works without fail

image

Do you mean v:Destroy . Not v:Remove

Use

if v.Name == "HomeScreen" or v.Name == "Freecam" then
    v:Destroy()
end

And also yes, use :Destroy()

He wants to remove the things that are not homescreen or freecam

Ok then use ~= instead of ==