So I know something is wrong with the math for the x and z parts of the CFrame, but I can't seem to figure out what the problem is. Its making what is supposed to be a sphere into a cylinder instead because the rings at the top aren't getting closer to each other. Currently its making the "sphere" look like this
Here is the code:
rings = 12
segs = 16
r = 20 -- radius
center = workspace.Core.PrimaryPart.Position
-- The center of the sphere, which can be any vector3 value
for i = -90,90,180/rings do
for j = 0,360 - (360/segs),360/segs do
part = Instance.new("Part")
part.Name = "SphereWall"
part.CanCollide = true
part.Anchored = true
part.Size = Vector3.new(4,4,1)
part.CFrame = CFrame.new(Vector3.new(
center.X + (math.cos(math.rad(j)) * r),
center.Y + (math.sin(math.rad(i)) * r),
center.Z + (math.sin(math.rad(j)) * r)),
center)
part.Parent = script.Parent
end
end

4 comments
you prob need to change the variables.... the value of the variables
Really? Theres a shape named Ball...................................... wonder what that shape looks like...............
@hiiimgoodpack oh gee... maybe i want to have a hollow sphere made out of as little parts as i want... so i can put stuff in them... while maintaining a blocky feeling in the sphere... the nerve of some people, smh EDIT: In the picture... in the middle of the "sphere"... i think those are cylinders too... you think?
then use solid modeling @Zukaazora