How would I make a formula for something like this

Alright so I am making a game where I have the player choose how many teams from 1 to 10. the problem is the flag bases need to spawn equidistant from the center and the one next to it, I will show what I mean.
This would be for three teams

For four teams

For eight teams

Basically all the parts are the same distance from the part next to it and are all the same distance from the center. As my boundary I am using a circle, if you think is a square is better tell me. Thank you for your help, if you think this is bad please propose an other suggestion for doing something like this.

And even after I solve this I have an other problem of these bases spawning on other map parts I also need help to solve that.

It’s a good thing I worked this out a year ago.

local count = 3
local size = 1
local off = 1.2
local dis = math.pi*2*size/count
local pos =,2,0)
function gen(t)
	local o ='Part')
	o.Name = 'Point'
	o.Anchored = true
	o.Size =,1,1)
	o.Shape = t
	return o
for i=0,count-1 do
	local cf = pos*CFrame.Angles(0,dis*i,0)*,0,-size*off)
	local o = gen(Enum.PartType.Block)
	o.CFrame = cf
	o.Parent = workspace

gen() just generates the part. You can replace that with whatever. off is the offset, uh… Count is the number of things. Anyway, I’m sure you can figure out the details. :+1:

Omg thank you so much if I dont get it can I dm you on dev forum

Sure, although it’d be better to contact me on my Discord. Though I forget if I’m allowed to put that here or not?

Uh I don’t know maybe you could PM me it on devforum just to be safe