This code is working just fine but I am wondering it there could be a function that has parameter or arguments to make this have less lines.
NOTICE: I'm pretty much repeating the code but some things a different.
while true do local canFade = true for i = 0,1,.001 do cam.CFrame = cam1.CFrame:lerp(cam2.CFrame,i) game:GetService('RunService').RenderStepped:wait() if i >= .98 and canFade then canFade = false fade(playerGui:FindFirstChild('Main').FadeBackground) end end local canFade = true for i = 0,1,.001 do cam.CFrame = cam3.CFrame:lerp(cam4.CFrame,i) game:GetService('RunService').RenderStepped:wait() if i >= .98 and canFade then canFade = false fade(playerGui:FindFirstChild('Main').FadeBackground) end end local canFade = true for i = 0,1,.001 do cam.CFrame = cam5.CFrame:lerp(cam6.CFrame,i) game:GetService('RunService').RenderStepped:wait() print'c' if i >= .98 and canFade then canFade = false fade(playerGui:FindFirstChild('Main').FadeBackground) end end local canFade = true for i = 0,1,.001 do cam.CFrame = cam7.CFrame:lerp(cam8.CFrame,i) game:GetService('RunService').RenderStepped:wait() if i >= .98 and canFade then canFade = false fade(playerGui:FindFirstChild('Main').FadeBackground) end end local canFade = true for i = 0,1,.001 do cam.CFrame = cam9.CFrame:lerp(cam10.CFrame,i) game:GetService('RunService').RenderStepped:wait() if i >= .98 and canFade then canFade = false fade(playerGui:FindFirstChild('Main').FadeBackground) end end end
Oh my yes. Make a parameter like cam and just switch out cam10,CFrame to cam so every time you call the function you can just write functionName(cam4.CFrame) or whatever 'cam' you plan to change. Hope I helped! ;)