Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I move a property into a different "directory"?

Asked by
tek_o 56
6 years ago

I have a ScreenGui for a loader and I want to move it into StarterGui. How do I do that? (its in a folder called Module, and the gui is called ScreenGui)

0
If the folder is in serverstorage, do game.ServerStorage.Module.ScreenGui.Parent = game.StarterGui Amiaa16 3227 — 6y

1 answer

Log in to vote
2
Answered by
nilVector 812 Moderation Voter
6 years ago

I think you mean moving an object or instance into a different "directory" in your title, not a property.

Nevertheless, to move an object/instance, you can simply reassign its Parent property to the new location you want it to be in. In your case, you want to move a loading GUI into the StarterGui, however, another mistake that I have found is that you should not be parenting objects to StarterGui during the runtime of the game. StarterGui is only replicated to a player's PlayerGui when he/she joins and each time he/she respawns, thus any changes you make to it won't be applied until the next respawn time.

That is why I recommend you parent your loading GUI directly to the player's PlayerGui. For example:

Module.LoadingGui.Parent = player.PlayerGui
Ad

Answer this question