There are many methods you can use to achieve your goal.
Here’s just one example:
UserInputService = game:GetService("UserInputService")
RunService = game:GetService("RunService")
Camera = workspace.CurrentCamera
CameraTurnSpeed = 2
RunService.Heartbeat:Connect(function()
for i,k in pairs(UserInputService:GetKeysPressed()) do
if k.KeyCode == Enum.KeyCode.A then
-- Turn camera left.
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(CameraTurnSpeed),0)
elseif k.KeyCode == Enum.KeyCode.D then
-- Turn camera right.
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,math.rad(-CameraTurnSpeed),0)
end
end
end)