Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How would I stop this script from glitching out when I spam it?

local player = game.Players.LocalPlayer

local mouse = player:GetMouse()

local camera = workspace.CurrentCamera

  

  

  

mouse.Button2Down:Connect(function()

for i = 1, 10 do

wait()

camera.FieldOfView = camera.FieldOfView - 3

end

end)

  

mouse.Button2Up:Connect(function()

for i = 1,10 do

wait()

camera.FieldOfView = camera.FieldOfView + 3

end

end)

Basically, spamming the left button on your mouse makes the animation glitch out a bit when zooming in and out, anyone know how to counter this? I tried with a wait loop but it does not work.

1 comment

0

Maybe wait until the FieldOfView is to the point where you want it to be, and then allow the players to put their FieldOfView back after they lift up a key?

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.