local Mouse = game.Players.LocalPlayer:GetMouse()
local TweenService = game:GetService("TweenService")
local Vignette = game.Players.LocalPlayer.PlayerGui:WaitForChild("ScreenGui"):WaitForChild("Vignette")
local ZoomIn = TweenService:Create(Vignette, TweenInfo.new(0.5), {ImageTransparency = 0})
local ZoomOut = TweenService:Create(Vignette, TweenInfo.new(0.5), {ImageTransparency = 1})
local CanFocus = true
local function Focus(State)
if State then
ZoomOut:Cancel()
ZoomIn:Play()
else
ZoomIn:Cancel()
ZoomOut:Play()
end
end
Mouse.Button1Down:Connect(function()
if not CanFocus then return end
Focus(true)
end)
Mouse.Button1Up:Connect(function()
Focus(false)
end)
I added the :Cancel() because if you did “focus” and quickly removed it, the two tweens would start working at the same time and the whole screen would start blinking
Now I remove the :Cancel() and it seems to work now Tysm!