I am trying to make a script that clones a frame and makes the parent something in starter GUI. On Click function. I am not sure if I can do something like this.
Frame:Clone() Frame.Parent =
I am trying to make a script that clones a frame and makes the parent something in starter GUI. On Click function. I am not sure if I can do something like this.
Frame:Clone() Frame.Parent =
Yes you can, when you clone something it copies the object, but it does not have a parent, meaning you would have to parent it
local Frame = script.Parent.Parent.Parent.Parent.Parent.ServerStorage.Data
local Clone = Frame:Clone() -- clones it
Clone.Parent = -- sets the parent, etc etc
You can also do;
local Frame = script.Parent.Parent.Parent.Parent.Parent.ServerStorage.Data
Frame:Clone().Parent = -- you do not have to make the clone a variable, you can also set the parent from here
Instance:Clone() wiki link: https://developer.roblox.com/en-us/api-reference/function/Instance/Clone
Hope this helps
why is that a classroom lmao
Instance:Clone() wiki link: https://developer.roblox.com/en-us/api-reference/function/Instance/Clone
SHSHJSHSJ SORRY LOL I CHANGED IT
--what you'd need to do is something like this:
local Frame = script.Parent.Parent.Parent.Parent.Parent.ServerStorage.Data
local CloneParent = game.--enter desired parent here
local CloneFrame = Frame:Clone()
CloneFrame.Parent = CloneParent
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Forgot to mention ''local Frame = script.Parent.Parent.Parent.Parent.Parent.ServerStorage.Data''
clone and then Clone.Parent = location
local clonedframe = Frame:Clone() clonedframe.Parent = instance