Table and ModuleScript Issue, can't remove Table's children

  1. What do you want to achieve?
  • Pick a random part and a random spawn.
  • Clone the part, and make its position the random spawn’s.
  • Remove the spawn from the available spawn pool.
  • Re-fill the pool once empty.
  1. What is the issue?
    Every method I’ve tried so far, mostly revolving around removing the children from the table, has failed. I’ve contacted dozens of people to no avail.

  2. What solutions have you tried so far?
    Methods such as table.remove, creating a new folder for approved spawns, creating a value to check if the spawn is being used or not, among many others.

Module Script

local eggModule = {}

-- Services
local replicatedStr = game:GetService("ReplicatedStorage")
local tweenService = game:GetService("TweenService")

-- Folders
local eggFolder = replicatedStr:WaitForChild("eggFolder")
local spawnFolder = workspace.gameFolder.Interactive:WaitForChild("eggSpawns")
local spawnedEggFolder = workspace.gameFolder.Interactive:WaitForChild("eggClones")

-- Settings
local Settings = {
	bodyPosTween =, 1, 0)

-- Module
function createEggTween(eggCopy)
	local bodyPos ="BodyPosition")
	bodyPos.Position = eggCopy.Position
	bodyPos.MaxForce =, 40000, 40000)
	bodyPos.Parent = eggCopy
	local posTween = tweenService:Create(bodyPos,, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), {
		Position = bodyPos.Position + Settings.bodyPosTween


function eggModule:spawnEgg(Rarity)
    local spawnTable = spawnFolder:WaitForChild(Rarity):GetChildren()
 	local randomSpawn = spawnTable[math.random(1, #spawnTable)]

	if #randomSpawn < 1 then
		local eggTable = eggFolder:WaitForChild(Rarity):GetChildren()
    	local randomEgg = eggTable[math.random(1, #eggTable)]
    	local eggCopy = randomEgg:Clone()
    	eggCopy.Parent = randomSpawn
   		eggCopy.Position = randomSpawn.Position


return eggModule

ServerScript (parent of Module, all in ServerScriptService)

-- Module
local eggModule = require(script.eggModule)

-- Folders
local gameFolder = workspace:WaitForChild("gameFolder")

-- Settings
local eggTypes = {

-- Loop
while wait(5) do
	local chosenType = eggTypes[math.random(1, #eggTypes)]
	local eggCount = gameFolder.Interactive.eggClones:GetChildren()
	if #eggCount < 5 then

I’ve included the full script in case the issue lies elsewhere.

Thank you in advance and stay safe!