zoom script model that i Made : https://www.roblox.com/catalog/02521288629/redirect
script.Parent.Equipped:Connect(function() local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() local char = game.Players.LocalPlayer.Character local zomm = true local cam = game.Workspace.CurrentCamera mouse.Button2Down:Connect(function() while zomm == true do wait() cam.CameraType = Enum.CameraType.Scriptable cam.CFrame = script.Parent.zoomin.CFrame end end) mouse.Button2Up:Connect(function() zomm = false cam.CameraType = Enum.CameraType.Custom wait(2) zomm = true end) end)
your setting the camera's CFrame (coordinate frame) and using a loop using wait() as a yield
A simpler way to do it is setting the camera subject to zoomin, and lock the player's camera to FirstPerson mode
Script would look like this:
script.Parent.Equipped:Connect(function() local plr = game.Players.LocalPlayer local mouse = plr:GetMouse() local char = game.Players.LocalPlayer.Character local zomm = true local cam = game.Workspace.CurrentCamera mouse.Button2Down:Connect(function() if zoom then cam.CameraSubject = script.Parent.zoomin -- sets camera subject to the scope plr.CameraMode = Enum.CameraMode.LockFirstPerson -- sets player’s camera to first person end end) mouse.Button2Up:Connect(function() zomm = false cam.CameraSubject = char:FindFirstChildOfClass(“Humanoid”) -- or change to your humanoid’s name plr.CameraMode = Enum.CameraMode.Classic -- makes player able to go into third person wait(2) zomm = true end) end)
tell me if it worked or not!