Here’s the code you posted that’s translated to Lua (roughly).
local num_pts = 1000
local indices = -- All floats from 0 to num_pts inclusively (for loop perhaps where i = float)
local phi = math.acos(1 - 2*indices/num_pts)
local theta = math.pi * (1 + 5*0.5) * indices
local x, y, z = math.cos(theta) * math.sin(phi), math.sin(theta) * math.sin(phi), math.cos(phi)
I found what I think is a more elegant solution. Let me know if it’s any help to you
local Ratio = (1 + math.sqrt(5))/2
local AngleIncrement = math.pi*2 * Ratio
local Spread = 30
local Points = 1000
local Part = script.Part
for i = 0, Points do
local Distance = i/Points
local Incline = math.acos(1 - 2*Distance)
local Azimuth = AngleIncrement*i
local X = math.sin(Incline) * math.cos(Azimuth) * Spread
local Y = math.sin(Incline) * math.sin(Azimuth) * Spread
local Z = math.cos(Incline) * Spread
local Point = Part:Clone()
Point.Position = Vector3.new(X, Y, Z)
Point.Parent = workspace.Points
end