I'm trying to make this model rotate normally, as if a table top or something.
function rotateMod(mod,center,rotation)
local parts ={}
local function scan(parent)
for _,obj in pairs(parent:GetChildren()) do
if (obj:IsA("BasePart")) then
table.insert(parts,obj)
end
scan(obj)
end
end
scan(mod)
for _,part in pairs(parts) do
part.CFrame = (center*rotation*(center:inverse()*part.CFrame))
end
end
local mod = game.Workspace["Lamp Post"]
local step = 1
repeat wait()
rotateMod(mod,mod:GetModelCFrame(),CFrame.Angles(0,math.rad(step),0))
until mod == nil
However, I have no idea how to do this. I've never really scripted before so I would have no clue where to start.

1 comment
Use SetPrimaryPartCFrame()