CameraPosition script problem

Hello guys!Today I was looking for a script for the camera position.I found a script in the roblox API

I’m new in Scripting and have a question,what’s wrong with him?Tell me please!
Bye bye! :wave:

What is that end for? There is no function or condition, so you can remove that bit.
Also, it might be because pos and lookAt are Vector3, so using CFrame on them might give an error (It did for me once)
Another thing I know is that since code runs once, the camera will be set once the game starts, so it might not be noticed.

In General, this script doesn’t work, right?

Well, I think so. Check the output when testing for some errors.

Well this is what I got

The bit means the script was supposed to end, until it saw there’s an unused end there, so it shows the error. Like I said, try removing it.

First of all, this has to be in a LocalScript

make a local script and put it inside Starter Gui

and put this code:

local pos =,10,0)
local lookat =,0,0)
local cameracframe =,lookat)
--put a wait() here if it doesnt work.
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable --make the camera scriptable 
workspace.CurrentCamera.CFrame = cameracframe

THANKS, you saved me!