code:
local CircleGui = script.Parent
-- Function to create a circle with given radius and segment count
local function createCircle(radius, segmentCount)
local angle = 360 / segmentCount -- Calculate the angle between each segment
local guiWidth = CircleGui.AbsoluteSize.X
local guiHeight = CircleGui.AbsoluteSize.Y
for i = 1, segmentCount do
local segment = CircleGui.segment:Clone() -- Clone the CircleSegment template
segment.Parent = CircleGui -- Set the CircleGui as the parent of the segment
-- Calculate the position of the segment
local xPos = math.cos(math.rad(angle * i)) * radius
local yPos = math.sin(math.rad(angle * i)) * radius
-- Set the position and rotation of the segment
segment.Position = UDim2.new(0.5, xPos - guiWidth/2, 0.5, yPos - guiHeight/2)
segment.Rotation = angle * (i - 1)
segment.Visible = true -- Make the segment visible
end
end
-- Call the createCircle function with desired radius and segment count
createCircle(150, 8) -- Adjust the radius and segment count as needed
result:
wanted result: