So I have an aim UserInputService thingy, but I have almost no idea how it works!
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton2 and equipped then
if (Camera.CoordinateFrame.p - game.Players.LocalPlayer.Character.Head.Position).magnitude < 1 then
zooming = true
UIS.MouseDeltaSensitivity = 90/originalView
for i = 1, 60 do
if zooming == false then break end
Camera.FieldOfView = Camera.FieldOfView + (45 - Camera.FieldOfView) * (i / 60)
RunServ.RenderStepped:wait()
end
zooming = false
end end
end)
local inputend = UIS.InputEnded:Connect(function (input, GameHandledEvent)
if not equipped then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
Firing = false
elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
zooming = false
UIS.MouseDeltaSensitivity = 1
for i = 1, 60 do
if zooming == true then break end
Camera.FieldOfView = Camera.FieldOfView + (originalView - Camera.FieldOfView) * (i / 60)
RunServ.RenderStepped:wait()
end
end
end)
I just want an explanation of how it works. I understand keybind functions and all that, but I don't know how the script knows if you're still holding down the mouse. Any ideas? Please note that this script works perfectly and that there are no errors.

1 comment
Oh wait, I see. Lol thanks.