---
# System prepended metadata

title: PID-1007

---

Here's an example of a Roblox script that spawns a part:

```lua
local part = game.Workspace.Part -- Replace ""Part"" with the name of the part you want to spawn
local spawnLocation = CFrame.new(0, 5, 0) -- Replace the coordinates with the desired spawn location

local newPart = part:Clone()
newPart.CFrame = spawnLocation
newPart.Parent = game.Workspace
```

This script first gets a reference to the part that needs to be spawned in the game world. It then creates a new instance of the part using the `Clone()` method. The `CFrame` property of the new part is set to the desired spawn location. Finally, the new part is parented to the game world using the `Parent` property [1].

You can also use the `Instance.new()` method to create a new part instead of cloning an existing one. Here's an example:

```lua
local part = Instance.new(""Part"")
part.Size = Vector3.new(2, 2, 2)
part.Position = Vector3.new(0, 5, 0)
part.Parent = game.Workspace
```

This script creates a new part using the `Instance.new()` method and sets its size and position. The new part is then parented to the game world using the `Parent` property [1].

Note that these scripts need to be placed inside a Script or LocalScript object in the game world to work. You can also use events like `PlayerAdded` or `Touched` to trigger the spawning of parts [3][4].