Cylinder Generator script not working

Whats Degrees? (undefined) variable

TotalRotations is the degrees you want to rotate the part by.
Rotation is the degree of rotation you want to start at.
Rotate Degrees is the degree that you rotate each new part by. It’s basically Rotation + RotateDegrees during each loop iteration. That way you can account for the previous parts orientation.

it compares nil and number, it’s not defined first

An easier way to plot the points in a circle would be to use trigonometry with math.sin and math.cos.

local inRad = math.rad(degree)
part.Position = Vector3.new(math.cos(inRad) * radius, 1, math.sin(inRad) * radius)

Something like this should work

1 Like

What does? Saying “it” doesn’t really let me know what you are referring to, especially since I mentioned a few different variables used in the script.

Degrees is never defined, what do i set it to