I was wondering how to copy a model / Group from something like Lighting and put into the Workspace, at your players position. The group / model contains a bunch of parts, so I can't just have them all set to the players exact position otherwise they will all get jumbled up.
(Think of this. I want a house to spawn around my player, encapsulating it)
This is somewhat of a simple task.
Some things you need to understand is the clone() event which would copy the model, moving a model to a certain position, in this case, cloning the model from lighting and putting into workspace at the players position.
There are 2 different ways to do this; - MoveTo - SetPrimaryPartCFrame
In my example, I'll use the SetPrimaryPartCFrame event instead of the MoveTo due to proficiency.
Before we get into that, you need to know a little about the 'PrimaryPart' of the model.
The PrimaryPart is the part which is positioned with the SetPrimaryPartCFrame(or MoveTo). Note when assigning the PrimaryPart that the part must be a descendant of the Model. If not, the PrimaryPart will be set to nil.
To set the primary part of the model, click on the model, and in the properties window, click on the empty box next to the name of 'PrimaryPart", then view your model in studio, and click the part to set it as the PrimaryPart. After this, you may notice there is not a blank box next to "PrimaryPart", but the name of the part you've clicked. If it is not there, then you're doing it wrong! (Don't select it from the Explorer window.)
Now, we can get into SetPrimaryPartCFrame. This is the CFrame of the PrimaryPart. All other parts in the model will also be moved and will maintain their orientation and offset respective to the PrimaryPart. This function will throw an error if no PrimaryPart exists for the Model.
Example of how this could be used:
local moveTo = game.Workspace.SpawnPart -- Gets the spawn part in workspace local moveModel = game.Lighting.RandomModel:Clone() -- Get a copy of 'RandomModel' out of lighting moveModel = game.Workspace -- put the RandomModel in Workspace moveModel:SetPrimaryPartCFrame(CFrame.new(moveTo.Position) -- This will set the model's position to the SpawnPart in workspace.
Hope this gives you a good understanding of how to move a model!