RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Create a camera system which adds Arma 3 camera movement and zoom to ROBLOX."
-- local script local camera = game.Workspace.CurrentCamera local player = game.Players.LocalPlayer local mouse = player:GetMouse() local isArma3Camera = false local zoomLevel = 1 local function toggleArma3Camera() isArma3Camera = not isArma3Camera if isArma3Camera then camera.CameraType = Enum.CameraType.Scriptable camera.FieldOfView = 70 else camera.CameraType = Enum.CameraType.Custom camera.FieldOfView = 70 end end local function updateArma3Camera() if isArma3Camera then local mouseDelta = mouse.delta local rotationX = mouseDelta.x / 100 local rotationY = mouseDelta.y / 100 camera.CFrame = camera.CFrame * CFrame.Angles(0, rotationX, 0) camera.CFrame = camera.CFrame * CFrame.Angles(rotationY, 0, 0) end end local function zoomIn() if zoomLevel < 3 then zoomLevel = zoomLevel + 1 camera.FieldOfView = camera.FieldOfView - 10 end end local function zoomOut() if zoomLevel > 1 then zoomLevel = zoomLevel - 1 camera.FieldOfView = camera.FieldOfView + 10 end end mouse.Button2Down:Connect(toggleArma3Camera) mouse.WheelForward:Connect(zoomIn) mouse.WheelBackward:Connect(zoomOut) game:GetService("RunService").RenderStepped:Connect(updateArma3Camera)