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

How to make a script.Parent.part to be moved to another Model?

How do I make a script that can take script.Parent.Part & move it into another Model?

Model1 Model2

The Part need to be moved from Model1 to Model2 how can I do that.

Current Script:

script.Disabled = false

local part = script.Parent.Union

-- Else no Script for now.

2 answers

✓ Accepted answer

You need to understand two things.

--First of all, if the script is disabled, then this will not run:
script.Disabled = false
--And therefore, it will remain disabled.

--Second of all, to switch Parents, just assign it a new one!
local part = script.Parent.Union
local model2 = workspace -- switch workspace to the wanted Model2
part.Parent = model2

1 comment

0

This one can be used for my thing with an extra dot.

Wait, the script's parent is in a part? If that's true, do this:

script.Parent.Parent = workspace.Model2

Solved. Your part is now in Model2.

If you want a non-relative way, then do this:

workspace.Model1.Part.Parent = workspace.Model2

This should work.

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