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 GoldenRatio = 1 + math.sqrt(5)/4
local AngleIncrement = math.pi*2*GoldenRatio
local Multiplier = 30
local Points = 20000
for i = 0, Points do
local Distance = i/Points
local Angle = AngleIncrement*i
local Incline = math.acos(1 - 2*Distance)
local Azimuth = AngleIncrement*i
local x = math.sin(Incline) * math.cos(Azimuth) * Multiplier
local y = math.sin(Incline) * math.sin(Azimuth) * Multiplier
local z = math.cos(Incline) * Multiplier
local Point = script.Part:Clone()
Point.Position = Vector3.new(x,y,z)
Point.Parent = workspace.Model
end