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

How do I transfer something that's cloned into a different parent?

Asked by 7 years ago

So I've been trying to do a data transfer of sorts by cloning a folder and moving it into another parent but when I do the transfer it takes the original folder as well out of the original parent because both folders have the same name.

SlotOne = script.Parent.Parent.Parent.Parent.Parent.Parent.Starters.StartersFrame.SlotOne
function onTransfer()
SlotOne.Appearance:Destroy()
wait(.1)
script.Parent.Parent.Appearance:Clone()
wait(.1)
script.Parent.Parent.Appearance.Parent = SlotOne
end
script.Parent.Parent.MouseButton1Down:connect(onTransfer)

Any suggestions?

1 answer

Log in to vote
0
Answered by 7 years ago

I am assuming you are trying to move line 5, so can't you just make a variable and then set that variable's parent to something else?Kind of like this.

Clone=script.Parent.Parent.Appearance:Clone()
Clone.Parent=SlotOne

I don't know if this is the problem, but try using variables more instead of going script.Parent.Parent.Parent.etc.

0
It worked thanks for your help! IAv_vAI 4 — 7y
0
No problem Ex_plore 62 — 7y
Ad

Answer this question