I'm relatively new to scripting and I tried making a script where a model from Lighting (specifically an NPC) would be cloned and placed into Workspace. I don't know if the model being an NPC has something to do with it disappearing after a second or because it has multiple parts.
wait(1)
game.Lighting.NPC:Clone().Parent = game.Workspace
When you clone a model into Workspace
, you’ll never know where it spawns. Another error is you used Lighting
as storage but that method is deprecated.
local npcClone = game:GetService("ServerStorage").NPC:Clone() clone.Parent = game.Workspace if clone:FindFirstChild"HumanoidRootPart" then clone.PrimaryPart = clone.HumanoidRootPart clone:SetPrimaryPartCFrame(CFrame.new(0, 1, 0)) end