Instead of constantly creating and removing the parts, just create the parts once and then update the positions only. That way you have less code that is looping.
First, you have to move the static code to the top of the loop, like so:
local diam=34
local blocks=36
local plz=game.Players.LocalPlayer
local model=Instance.new("Model", workspace)
model.Archivable=false
The model is only going to be made once, so that's why we don't need to have it in a loop.
Now, we have a loop that is creating blocks constantly, but we only want it to create the blocks once so that the loop can just access the blocks and change their positions without having to create more blocks. To do this, we'll need to know how to use Tables
Tables are basically arrays that can be used to hold items. So in our case, that table will hold all the bricks that will be in the circle, like so:
local blockTable={}
for r=1,blocks do
local bl=Instance.new("Part",model)
bl.FormFactor="Custom"
bl.Anchored=true
bl.Size=Vector3.new(1,1,1)
table.insert(blockTable,bl)
end
The above code will create all the blocks and insert them into a table called "blockTable"
This allows us to access the table from the loop and change their positions, like so:
game:GetService("RunService").RenderStepped:connect(function()
for r, bl in pairs(blockTable) do
local plc=(plz.Character.Torso.CFrame*CFrame.Angles(0,math.rad(90),0)):toWorldSpace(CFrame.new() +
(CFrame.new() * CFrame.Angles(math.rad(r*(360/blocks)),0,0)).lookVector *
(.5*diam))
bl.CFrame=plc
end
end)
Final code:
local diam=34
local blocks=36
local plz=game.Players.LocalPlayer
local model=Instance.new("Model", workspace)
model.Archivable=false
local blockTable={}
for r=1,blocks do
local bl=Instance.new("Part",model)
bl.FormFactor="Custom"
bl.Anchored=true
bl.Size=Vector3.new(1,1,1)
table.insert(blockTable,bl)
end
game:GetService("RunService").RenderStepped:connect(function()
for r, bl in pairs(blockTable) do
local plc=(plz.Character.Torso.CFrame*CFrame.Angles(0,math.rad(90),0)):toWorldSpace(CFrame.new() +
(CFrame.new() * CFrame.Angles(math.rad(r*(360/blocks)),0,0)).lookVector *
(.5*diam))
bl.CFrame=plc
end
end)
Hope this helped!