So I’ve got this code to check if a player has a certain GUI, but the way I check is getting rather lengthy. I’m also worried about the efficiency of it in the first place, since surely this can’t be good for the server.
if not player.PlayerGui:FindFirstChild("Main") or not player.PlayerGui.Main:FindFirstChild("DialogBox") then return false end local dialogBox: Frame = player.PlayerGui.Main.DialogBox
What I’m checking in this code bit doesn’t really matter, but I’m asking if there’s a better way to check if (in this case) DialogBox is nil, rather than the baby steps I have to do.
Note: the reason why I have to do baby steps is because it’ll give an error like: “Main is not a valid member of PlayerGui”