How to clone a part and have a script inside it run?
Asked by
5 years ago Edited 5 years ago
I have a mesh part inside of ReplicatedFirst with a simple script attached:
However, when I clone it into workspace, it doesn't run. I don't understand why. What am I doing wrong?
Edit:
I tried to set the script's Disabled property to True and then after I cloned the part, set it back to false, but it still didn't run:
This is the function I am using to spawn the meshPart
01 | local function CreateNewPart(partToCreate, position) |
02 | local copy = partToCreate:Clone() |
03 | copy.CFrame = CFrame.new() |
05 | copy.CanCollide = true |
06 | copy.Position = position |
07 | copy.Orientation = Vector 3. new( 0 , 0 , 0 ) |
08 | copy.Parent = platformsFolder |
09 | copy.Script.Disabled = false |
10 | print (copy.Script.Disabled) |
The output from the print() is "false"