What Im trying to do is make a variable (Lets call this variable N) that will go up as I click a gui button which is easy, but as that variable goes up I have a list of parts called Camera1, Camera2, Camera3, etc. Instead of making an if statement for every Camera I want every time the variable goes up, for example N = 2 I would want my charectors Camera.Cframe to switch to Camera2's Camera.Cframe. Thanks
local CurrentMap = 1
Next.MouseButton1Click:connect(function()
Camera.CameraType = Enum.CameraType.Scriptable
if CurrentMap ~= 2 then
CurrentMap = CurrentMap + 1
if CurrentMap == 2 then
Camera.CFrame = workspace.Camera2.CFrame
end
end
end)
Previous.MouseButton1Click:connect(function()
Camera.CameraType = Enum.CameraType.Scriptable
if CurrentMap ~= 1 then
CurrentMap = CurrentMap - 1
if CurrentMap == 1 then
Camera.CFrame = workspace.Camera1.CFrame
end
end
end)

4 comments
Awesome! thanks man.
I also have another question why would you put two dots between "Camera" .. CurrentMap, I don't really understand that.
That's the concatenation operator; it joins strings together, ex: print("Hello " .. "There") -- Hello There
alrighty man, thanks much help!