Parts of model is not spawning at spawner

I got a spawner script and used it to spawn enemies. I wanted to use it to spawn models, but everytime I try to spawn a model, the primary part of the model is the only one that gets spawned at the spawners location. The rest of the model is spawned at the place it was at before it got put into replicated storage. How do I fix this?

script:

local NPC = game.ReplicatedStorage. --ObjectNameHere
local spawner = script.Parent


  local Clone = NPC: Clone()
 Clone.Parent = workspace
 Clone.PrimaryPart.CFrame = spawner.CFrame

try spawning grouped up parts (models) with this script, not humanoid models and then you’ll see what I mean

1 Like

You were in the right track but you should use this api, it’ll move all the parts with the primaryPart
https://developer.roblox.com/en-us/api-reference/function/Model/SetPrimaryPartCFrame

Clone:SetPrimaryPartCFrame(spawner.CFrame)
1 Like

thanks! It works now!

my new script is:

local NPC = game.ReplicatedStorage. --ObjectNameHere
local spawner = script.Parent


  local Clone = NPC: Clone()
 Clone.Parent = workspace
Clone:SetPrimaryPartCFrame(spawner.CFrame)