I'm trying to clone a part from ReplicatedStorage and put it on my map every 10 seconds using server script.

-- Part generator server script

local RS = game:GetService('ReplicatedStorage')

local locations = {
	Vector3.new(0, 0, 0),
	Vector3.new(1, 1, 1),
	Vector3.new(2, 2, 2)
}

while(wait(10)) do
    local newPart = RS.Parts.Part:Clone()
    newPart.Parent = workspace.Parts
    newPart.CFrame = CFrame.new(locations[math.random(1, #locations)])
end

The part goes to workspace.Parts but then disappears right after without returning any error. I have no idea, could someone help please?

2 comments

0

It can be falling into the void, is it Anchored?

2

Oh, it isn't! I'm quite new to Roblox Studio and I thought that the parts are anchored by default. So that's why they disappeared, thank you very much! :)