Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Getting "trying to set locked parent" in console?

What my game does it move a GUI out of ReplicatedStorage to Player's PlayerGui, though when game starts I get the warning once, then the Gui is removed and it appears again.

What's going on here?

Code cloning and setting parent of GUI:

local GUI = game.ReplicatedStorage.Client.Misc.Menu:Clone()
local pg = Player:WaitForChild("PlayerGui")
GUI.Parent = pg

1 answer

seems that you :destroy() the gui but then your script tries to set it's parent again (the :Destroy() function locks instance's parent so you can't get access to it anymore)

This discussion is preserved as it was. New answers, comments, and votes are closed.