I found a weird bug. Here is how I found it. First, I imported the same GUIs and scripts from my other place where everything worked fine and now for some reason, I am now getting an error:
`Players.iNoobe_yt.PlayerGui.MenuGui.Menus.Worlds.Info.TeleportHandler:9: attempt to index field 'Parent' (a nil value)
Even though I get this error the script seems to be running fine in-game, however, I would still like to get it fixed. Here is the hierarchy and the line of the script where the error occurs:
This is one reason why you should populate your UI with scripts instead of physical instances. For example, you could be using Roact and avoid this whole “nil parent” problem altogether because you’re not having to either wait for instances or locate instances in a giant mess of UI that you’ve created.
You’re currently using a bunch of GUI instances to make your UI (which is fine in most cases), I’m just saying using a script to manage your UI could solve your problem as all of your references would be in your codebase. Roact provides a great framework for UI on Roblox; it’s straightforward, lightweight, and draws from concepts of React.js.
You also don’t even have to use Roact, you could just manually jot in GUI elements if you wanted.