Hello and thank you for taking time out of your day to read this. Right now I'm writing a script to clone a GUI into PlayerGui, because if I left the GUI in StarterGui and it was deleted it would not return on respawn. Anyways, This is the script I'm currently using to try and clone the GUI into PlayerGui

-- Variables --
local GUI = game.ReplicatedStorage["Stand Select"]
local plr = game.Players.LocalPlayer
local Char = plr.Character
local UI = plr:WaitForChild("PlayerGui")

-- Clone Gui into player manually
wait(0.1) -- Make sure the player loaded but easier lol
GUI:Clone().Parent = UI -- Clone the Gui and put it in the Players Gui?


This seems like it would work, but the issue is that when I clone it instead of cloning into PlayerGui it clones into Player.Character (the script is in StarterCharacterScripts and it is a local script if that affects anything). Let me know if you need any more information.

Also, The reason I have so many notes is that this is a project in a group and we need to leave notes or each other in the scripts. (what I'm trying to say is Collaborative editing is on if that could be an issue)

3 comments

0

Instead of using :WaitForChild(), try to remove that part and just simply write plr.PlayerGui. That might help.

0

And if that does not work, then try to do GUI:Clone().Parent = plr.PlayerGui yeah I know that doesn't make any difference but it is good for the sake of trying.

0

I've tried both of those in the past, sadly neither worked. What im using right now is something I rarely use( variables to signify parents and :WaitForChild())