hello i have a script that when u press f it makes ur screen zoom out, however when u press it. It goes to 70.9 then back to 70, Ive tried everything but it doesnt work! This is a local script but does anyone have any idea how to fix this? full script isnt in here but it does have ends and a wait() then debounce = false
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
wait(0.1)
local tweeninfo = TweenInfo.new(0.5)
local cam = workspace.CurrentCamera
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.F then
if debounce == false then
debounce = true
TweenService:Create(cam, tweeninfo, {FieldOfView = 90}):Play()
wait()
debounce = false
end
end
end)
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Field = 90
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.F then
TweenService:Create(workspace.CurrentCamera, TweenInfo.new(0.5), {FieldOfView = Field}):Play()
Field = 90-Field+70
end
end)
I don’t know why, since everything works for me, are you sure that there are no errors in the console, you placed the script where necessary, there are no other scripts that change the FOV
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local Field = 90
UIS.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.F then
print(Field)
TweenService:Create(workspace.CurrentCamera, TweenInfo.new(0.5), {FieldOfView = Field}):Play()
print(workspace.CurrentCamera.FieldOfView)
Field = 90-Field+70
end
end)