I'm trying to detect if a screenGui is a valid member of the player gui because I'm cloning it into the player with a 'E' to interact code I've made but I must be able to check if there is already a screenGui in the player and if there isn't then it will clone it in other wise it won't do anything. Somebody please help me.
if game.Players.LocalPlayer.PlayerGui:FindFirstChild("ScreenGui") ~= nil then
This should be what you're looking for. Just change it to fit how you're coding it
Use This if you want to check if it exists:
if Where its need to be valid:FindFirstChild("Whats Needs to be valid") then What Is going to happen if its valid
end Or This If you Want to know if its doesn't exist:
if not Where its need to be valid:FindFirstChild("Whats Needs to be valid") then What Is going to happen if its valid
end
I Hope this is what u want