I have a script that detects, when player presses LeftAlt, but it only works in Studio.
local UIS = game:GetService("UserInputService")
local Body = workspace["DAF XF"].Body
local Camera = workspace.Camera
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftAlt then
if Camera.FieldOfView == 25 then
Camera.FieldOfView = 70
else
Camera.FieldOfView = 25
end
end
end)
try to paste this script and show me what it outputs
local UIS = game:GetService("UserInputService")
local Body = workspace["DAF XF"].Body
local Camera = workspace.Camera
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftAlt then
print("Input Began 1")
if Camera.FieldOfView == 25 then
Camera.FieldOfView = 70
else
Camera.FieldOfView = 25
end
end
end)
Try creating a new local script in StarterGui with this code and see if it works.
local UIS = game:GetService("UserInputService")
local Camera = workspace.CurrentCamera
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftAlt then
if Camera.FieldOfView == 25 then
Camera.FieldOfView = 70
else
Camera.FieldOfView = 25
end
end
end)