How do I make a tool click once to zoom in, and then another click to zoom out? Help is appreciated!
1 Like
What do you mean? Just a general FOV zoom in on mouse click? Can you elaborate further
Well, what i’m trying to do is, when the tool is activated, I want it to lock in first person mode and change the fov to 5, and then once clicked again, it puts the CameraMode into classic, and then puts the fov back to 75.
--Services
local Players = game:GetService("Players")
--Player
local Player = Players.LocalPlayer
--Cam
local Camera = workspace.CurrentCamera
--Identify your tool here:
local Tool = script.Parent
--Debounce
local debounce = false--will toggle this every time tool gets activated
Tool.Activated:Connect(function()
if debounce == false then
debounce = true
Player.CameraMode = Enum.CameraMode.LockFirstPerson--changing camera to lock into first person
Camera.FieldOfView = 5--adjusting FOV to 5
else
debounce = false
Player.CameraMode = Enum.CameraMode.Classic--resetting camera mode
Camera.FieldOfView = 75--resetting fov
end
end)
2 Likes
Actually, it only works once, and It won’t do it again.
Try adding an elseif statement to @Motofied’s code
Tool.Activated:Connect(function()
if debounce == false then
debounce == true
Player.CameraMode = Enum.CameraMode.LockFirstPerson--changing camera to lock into first person
Camera.FieldOfView = 5--adjusting FOV to 5
elseif debounce == true then
debounce = false
Player.CameraMode = Enum.CameraMode.Classic--resetting camera mode
Camera.FieldOfView = 75--resetting fov
debounce = false
end
end)
end