Not sure why, but this script doesn’t work. It’s supposed to constantly set the cameras CFrame to the aimparts CFrame and yet it doesn’t do that, all it does is zoom in but the Cameras CFrame stays the exact same, I have tried setting the cameratype to scriptable, setting the subject, and others and yet it won’t work.
Before aiming:
After:
(sorry for weird zoom not sure what happened)
game.Players.LocalPlayer:GetMouse().Button2Down:Connect(function()
local camera = workspace.CurrentCamera
if game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Tool") then
if game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Tool"):FindFirstChild("Gun") then
if game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Tool").GunStuffs:FindFirstChild("AimAT") then
game.UserInputService.MouseDeltaSensitivity = 0.25
en = false
game.TweenService:Create(camera,TweenInfo.new(1,Enum.EasingStyle.Quart,Enum.EasingDirection.Out,0,false),{FieldOfView = 30}):Play()
repeat
camera.CFrame = camera.CFrame:Lerp(game.Players.LocalPlayer.Character:FindFirstChildWhichIsA("Tool").GunStuffs:FindFirstChild("AimAT").Value.CFrame,1)
task.wait()
until
workspace.CurrentCamera.FieldOfView < 31
end
end
end
end)
game.Players.LocalPlayer:GetMouse().Button2Up:Connect(function()
en = true
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.TweenService:Create(workspace.CurrentCamera,TweenInfo.new(0.5,Enum.EasingStyle.Circular,Enum.EasingDirection.Out,0,false),{FieldOfView = 100}):Play()
game.UserInputService.MouseDeltaSensitivity = 1.5
end)