Model not going where I want and is straight up lying

I am working on a system where the part spawns in the boundaries of another part.

Here is the code for setting the position:

local pos = SpawnPosition(game.Workspace.Baseplate,16)
	print(pos)
	
	Model:PivotTo(CFrame.new(pos))
	print(Model:GetPivot())

Here is the code of randomly generating the position:

local Pos


	local x = math.random(Part.Position.X-(Part.Size.X/2),Part.Position.X+(Part.Size.X/2))
	local z = math.random(Part.Position.Z-(Part.Size.Z/2),Part.Position.Z+(Part.Size.Z/2))
	local y = height
	local y = height
	Pos = Vector3.new(x,y,z)

The output is the following:
image
It shows that it is being set but when I check the model of someone of them they are not there and are just randomly in this area:


this is the nearest model to the border of this weird area (and its position):
image
image

Note (the size of the part they are based around is this big):
image

fixed it another script has interfering with the parts

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.