I have 12 parts in a model how do I rotate the whole model (From ( 0,0,-30) to (0,0,-60)) This does one part at a time. How do I do the whole model at once? I don't need a very good graphics card do I like people are saying? (That was 109 parts. This is 12 it should work with no lag right?)
local Model = script.Parent
function Move()
for Index,Part in pairs(Model:GetChildren()) do
if Part:IsA("BasePart") then
for i=1,30 do
Part.CFrame = Part.CFrame*CFrame.fromEulerAnglesXYZ(0,0,-.1)
wait(.1)
end
wait()
end
end
end
script.Parent.Handle.ClickDetector.MouseClick:connect(Move)

9 comments
So you just had to change some of their positions?
@ TheContinentofEurope What do you mean? By positions, are you referring to the program flow, or the positions of the parts?
Program. sry :P
@ TheContinentofEurope Well, yes, but it makes a huge difference. It's like doing
error() object:Destroy()instead ofobject:Destroy() error(). Similarly to error(), wait(.1) influences the way the rest of the program is executed, so the order of operations matters a lot.Although this solution works completely fine (and its good), using PrimaryPartCFraming would make the code a lot shorter and much more effecient.
@DigitalVeer Maybe that was what the asker intended, but wouldn't that do something completely different? This script rotates the parts independently from eachother, while SetPrimaryPartCFrame would rotate the positions around the primary part too, instead of just rotating everything around it's own axis. It depends on what the asker wants.
I only assumed due to in the question, he wrote "how do I rotate the whole model"
@DigitalVeer I understand. It may be useful if you post your answer as well, in case that's waht the asker intended. (Not in reply to you, but on a side note, I noticed an mistake in my answer and fixed it.)
It didn't quite work as I wanted it to. But it is fine. I have scraped the idea I was doing. Thanks!