:FindFirstChild returns true even though there is nothing with that name

I have this script to check if the GUI is already open in the screen,

script.Parent.ClickDetector.MouseClick:Connect(function(plr)
	if plr:GetRankInGroup(groupID) >= minRank then
		if not plr.PlayerGui:FindFirstChild("GateScreensControl") then
			--Code
		end
	end
end)

It works the first time, but when I close the Gui (:Destroy()) and then re-run the script it no longer works. Any idea why?

I think you forgot to set it to false when the gui gets closed?

It’s FindFirstChild, if it’s not there then it shouldn’t return true

But if the gui dissapears you don’t move it across the game to workspace or so, you put it on invisible or disabled right? that’s why its still in findfirstchild

I use :Destroy()
On the explorer it doesn’t show

Try looking on server side instead of user side when testing and look if it’s in the explorer then.

It’s a script on the workspace

?? try testing and switch from client to server in the testing tab, then look if you can see the gui in explorer, probably you will