What I am trying to achieve here is basically:
When the player touches this part (working)
I need to check if a Gui exists in the player (trying to achieve)
And if it DOESN'T, then continue with the script (also trying to achieve)
If it DOES, then finish (also trying to achieve)
Right now I have a duplicated GUI where one is confused what to do.
The game also has Filtering Enabled.
FindFirstChild finds an object that has the the parent inidcated with the name you indicate.
For example...
game.Workspace:FindFirstChild("PartName") -- game.Workspace is the parent where we are searching and PartName is the name of the part.
If the script doesnt find anything with that name, it will return nil(Which in Lua means nothing).
game.Workspace:FindFirstChild("AnameThatDoesntExist") -- This will return nil
So, we could do...
if game.PlaceWhereYouWantToSearch:FindFirstChild("PartName") == nil then -- Script to do when there isn't that object end
If you want to check if a ScreenGui is there, insert a localscript inisde StarterGui:
if script.Parent:FindFirstChild("GuiName") == nil then -- Script to do when there isn't that ScreenGui end
Hope it was helpfull! If you have any doubts, tell me. Wiki article: http://wiki.roblox.com/index.php?title=API:Class/Instance/FindFirstChild