Model not instantiating properly

In my game, I plan to make plots for each of the players in the server. The plots are created when the server is started, but deleted and re-added to refresh if the player has left.

My problem is that the finished plots look like this when I start the server

I originally wanted to pre-place them, but then every time I wanted to change the plot, it would have me replacing all spawned plots manually, So instead I made it so on the start of the server it would place them. Which meant that they spawned like this.

it also gets worse whenever someone leaves and rejoins, with the white plates moving further and further out.

Here is the normal plot for reference.

Below you can find the code that is used for spawning the plots.

ModuleScript for managing
local GS = {}

-- Spawn Plot with given number
function GS.SpawnPlotFromID(ID)
	local NewPlot = game.ReplicatedFirst.Plot:MoveTo(Vector3.new(0, 0, 0))
	local Plots = workspace.Plots:GetChildren()
	
	local PlotSpacing = 150


	local NewPlot = game.ReplicatedFirst.Plot:Clone()
	NewPlot.Parent = workspace.Plots

	local AssingedPlayer = Instance.new("IntValue", NewPlot)
	AssingedPlayer.Name = "AssignedPlayer"
	AssingedPlayer.Value = 0

	local PlotID = Instance.new("IntValue", NewPlot)
	PlotID.Name = "PlotID"
	PlotID.Value = ID

	NewPlot:MoveTo(Vector3.new(100,0, PlotSpacing * (ID - 4)))
	return NewPlot
end

-- Spawn All Plots when starting server
function GS.SpawnPlots()
	for count = 1, 8, 1 do
		GS.SpawnPlotFromID(count)
	end
end

function GS.DeleteAllPlots()
	for i, plot in pairs(workspace.Plots:GetChildren()) do
		GS.DeleteSlots(plot.PlotID.Value)
		plot:Destroy()
	end
end

-- Assign Plot to Player
function GS.AssignPlotToPlayer(player)
	local Plots = workspace.Plots:GetChildren()
	local playerID = player.UserId
	
	for i, plot in pairs(Plots) do
		if plot.AssignedPlayer.Value == 0 then
			plot.AssignedPlayer.Value = playerID
			GS.BringPlayerToPlot(player)
			return plot
		end
	end
end

function GS.GetPlotFromID(PlotID)
	local Plots = workspace.Plots:GetChildren()
	
	for i, plot in pairs(Plots) do
		if plot.PlotID.Value == PlotID then
			return plot
		end
	end
end

-- Find A Plot Belonging to Given Player
function GS.GetPlotFromPlayer(player)
	local playerID = player.UserId
	local Plots = workspace.Plots:GetChildren()
	
	for i, plot in pairs(Plots) do
		if plot.AssignedPlayer.Value == playerID then
			return plot
		end
	end
end

-- Reset Player's Plot After They Leave
function GS.ResetPlayersPlot(player)
	local Plot = GS.GetPlotFromPlayer(player)
	local PlotID = Plot.PlotID.Value
	Plot:Destroy()
	
	GS.SpawnPlotFromID(PlotID)
end

function GS.BringPlayerToPlot(player)
	local Plot = GS.GetPlotFromPlayer(player)
	
	local Character = player.Character
	
	Character:MoveTo(Plot.SpawnPos.Position)
end

return GS

Server script for managing
local GS = require(game.ReplicatedStorage.GameSystem)
local DS = require(game.ReplicatedStorage.DataSystem)

for i,v in pairs(game.Workspace.PlotOutlines:GetChildren()) do
	v:Destroy()
end

GS.SpawnPlots()


function PlayerSpawned(player)
	player.CharacterAdded:wait()
	local plot = GS.AssignPlotToPlayer(player)
	
	local leaderstats = DS.CreateLeaderstats(player)
	local Stats = DS.CreateStatsData(player)
end

function PlayerLeft(player)
	GS.ResetPlayersPlot(player)
end

game.Players.PlayerAdded:Connect(PlayerSpawned)
game.Players.PlayerRemoving:Connect(PlayerLeft)

Also, the referenced files in the server script, GS and DS are two module scripts. GS is the one that spawns and manages the plots, named GameSystem, and DS is for datastores and leaderstats, so it has nothing to do with the spawn system.

Thank you in advance for any help.

So, the placement of your plots is a math mistake.
You’re constantly adding values without ever returning to the second row of plots.
Based on the reference, you’re supposed to have two rows of four plots.
Instead of repositioning only with the ID, you should also adjust the X position and reset the Z position for the second row.

I don’t really have much more information about how your game spawns your plots in one example instead of multiples, but I am trying to understand it.

Try using this formula, you can adapt it to match your spacing. Change 200 to the spacing you want between the two lines:

NewPlot:MoveTo(Vector3.new(100 - 200 * math.floor(ID/5), 0, PlotSpacing * ((ID % 4) + 1)))

And to make this work, you also need to change the loop to increment from 0 to 7 instead of 1 to 8:

for count = 0, 7 do
    GS.SpawnPlotFromID(count)
end

are u from unity bc ive only ever seen instantiate used in unity code, also dont use moveto its buggy, use setPrimaryPartCFrame or smth along the lines of that

I think SetPrimaryPartCFrame is deprecated, PivotTo is a better option

Sorry for the late response. I don’t come from Unity, I come from Godot. When you want to change a scene or add a new Scene in Godot, you use Instantiate