-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera -- Remove previous UI if the script is executed again if game.CoreGui:FindFirstChild("CenterCameraUI") then game.CoreGui.CenterCameraUI:Destroy() end -- Remove previous camera connection if getgenv().CenterCameraConnection then getgenv().CenterCameraConnection:Disconnect() getgenv().CenterCameraConnection = nil end getgenv().CenterCameraEnabled = true --// GUI local gui = Instance.new("ScreenGui") gui.Name = "CenterCameraUI" gui.ResetOnSpawn = false gui.Parent = game.CoreGui local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 180, 0, 80) frame.Position = UDim2.new(0.5, -90, 0.1, 0) frame.BackgroundColor3 = Color3.fromRGB(25, 25, 25) frame.BorderSizePixel = 0 frame.Parent = gui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 10) corner.Parent = frame local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 30) title.BackgroundTransparency = 1 title.Text = "Center Camera" title.TextColor3 = Color3.fromRGB(255, 255, 255) title.TextSize = 16 title.Font = Enum.Font.SourceSansBold title.Parent = frame local button = Instance.new("TextButton") button.Size = UDim2.new(0, 140, 0, 30) button.Position = UDim2.new(0.5, -70, 0, 38) button.BackgroundColor3 = Color3.fromRGB(40, 170, 80) button.TextColor3 = Color3.fromRGB(255, 255, 255) button.TextSize = 15 button.Font = Enum.Font.SourceSansBold button.Text = "ON" button.Parent = frame local buttonCorner = Instance.new("UICorner") buttonCorner.CornerRadius = UDim.new(0, 7) buttonCorner.Parent = button --// Camera function local function restoreCamera() camera.CameraType = Enum.CameraType.Custom local character = player.Character local humanoid = character and character:FindFirstChildOfClass("Humanoid") if humanoid then camera.CameraSubject = humanoid end end local function startCameraLock() if getgenv().CenterCameraConnection then getgenv().CenterCameraConnection:Disconnect() end getgenv().CenterCameraConnection = RunService.RenderStepped:Connect(function() if not getgenv().CenterCameraEnabled then return end local character = player.Character local root = character and character:FindFirstChild("HumanoidRootPart") if root then camera.CameraType = Enum.CameraType.Scriptable local position = root.Position + Vector3.new(30, -4, 0) camera.CFrame = CFrame.lookAt(position, root.Position) end end) end --// Toggle button.MouseButton1Click:Connect(function() getgenv().CenterCameraEnabled = not getgenv().CenterCameraEnabled if getgenv().CenterCameraEnabled then button.Text = "ON" button.BackgroundColor3 = Color3.fromRGB(40, 170, 80) startCameraLock() else button.Text = "OFF" button.BackgroundColor3 = Color3.fromRGB(170, 50, 50) if getgenv().CenterCameraConnection then getgenv().CenterCameraConnection:Disconnect() getgenv().CenterCameraConnection = nil end restoreCamera() end end) -- Start enabled startCameraLock()