Infinitely Spawning Part not Spawning

I have a normal script in a part that’s supposed to clone a part, then destroy it after a second, however, the part does not spawn, and I do not have a clue why.

This is the script:

--Variables
local debris = game:GetService("Debris")
local serverStorage = game.ServerStorage
local dropPart = serverStorage.DropPart
local dropper = script.Parent
local pos = dropper.Position
local newPos = pos + Vector3.new(0, -1, 0)

--Looping the part spawning
while true do
    local newPart = dropPart:Clone()
    newPart.Position = newPos
    debris:AddItem(newPart, 1)
    wait(.1)
end

When I throw in a print() statement in the loop, it prints, but still no spawning.

  1. What do you want to achieve? I want to make a part infinitely spawn.

  2. What is the issue? The part isn’t spawning at all.

  3. What solutions have you tried so far? I tried to google my solution, but found nothing that could help.

I also tried moving the part that will spawn into ReplicatedStorage to see if it would work after that, and guess what? It didn’t work. No errors, no warns, no nothing.

You need to set the parent of newPart. When you call :Clone() the duplicate is automatically parented to nil

1 Like

You need to set the parent of the part. Cloned objects Parent’s are set to nil.

1 Like