Hi there guys. I am currently building an automated Train System, but I found out that there's a big problem. The Train clones perfectly, but immediately falls apart once I set the Parent to Workspace. The script works fine, but I don't know weather it is a building issue or if I am missing anything from the script?
-- Script is in the Workspace, Train(Model) is in lightning train = game.Lightning.Train while true do train:Clone() train.Parent = Workspace wait(30) end
Studio does not crash during the while loop. Once I play, Everything is fine until the train clones and it explodes everywhere like a bomb going off. Please Help?
All you need to do is call the
MakeJoints method on it. Also you need to be careful with what you are parenting to the Workspace.
Here is the correct code:
train = game.Lighting.Train while true do local newTrain = train:Clone() newTrain.Parent = Workspace newTrain:MakeJoints() wait(30) end
If this doesn't work, you may need to weld things together.
train = game.Lighting.Train -- Not Lightning while true do local clone = train:clone() clone:MakeJoints() -- Manually connect it using this method. clone.Parent = workspace clone:MakeJoints() -- Just in case. One more time. wait(30) end