I've created a map, and modeled it. How would I make it rotate? Like spinning clockwise??
function rotateMod(mod,rotation) local center = mod:GetModelCFrame() 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 while true do wait (0.4) rotateMod(game.Workspace.Map,CFrame.Angles(0,-0.2,0)) end
Change the Map in "rotateMod(game.Workspace.Map,CFrame.Angles(0,-0.2,0))" To whatever the name of the map model is there you go!
You could use a for loop, constantly adding 1 to the rotation every 0.1 or 0.01 second
for i = 0,math.huge do map.Rotation = Vector3.new(0,i,0) wait(0.01) end
This adds 1 to the rotation every 0.01 of a second. I have tried making the map.Rotation = map.Rotation+Vector3.new(0,i,0) but that doesn't seem to have worked