local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local remote = ReplicatedStorage.MinesIncrementalRemotes.Action local playerGui = player:WaitForChild("PlayerGui") local grid = playerGui:WaitForChild("MineCoreGui"):WaitForChild("GameShell"):WaitForChild("Board"):WaitForChild("Grid") local controls = playerGui:WaitForChild("MineCoreGui"):WaitForChild("GameShell"):WaitForChild("Controls") local primaryAction = controls:WaitForChild("PrimaryAction") local roundResult = playerGui:WaitForChild("MineCoreGui"):WaitForChild("GameShell"):WaitForChild("Board"):WaitForChild("RoundResult") local isRunning = true local function getState() return remote:InvokeServer("GetState") end local function revealSafeTiles() local state = getState() local round = state.State and state.State.Round if not (state.Ok and round and round.Active) then return false end local mines = {} for _, mineIndex in ipairs(round.Mines) do mines[mineIndex] = true end local revealed = {} for _, tile in ipairs(round.Revealed) do revealed[tile.Index] = true end -- Pré-cache toutes les connexions local buttons = {} for tileNumber = 1, round.BoardTiles do local button = grid:FindFirstChild("Tile" .. tileNumber) if button then local face = button:FindFirstChild("Face") if face then local connections = getconnections(face.Activated) if #connections > 0 then buttons[tileNumber] = connections end end end end for tileNumber = 1, round.BoardTiles do if not mines[tileNumber] and not revealed[tileNumber] then local connections = buttons[tileNumber] if connections then for _, connection in ipairs(connections) do pcall(function() connection:Fire() end) end end end end return true end local function clickPrimaryAction() if not primaryAction then return false end local connections = getconnections(primaryAction.Activated) if #connections == 0 then connections = getconnections(primaryAction.MouseButton1Click) end if #connections > 0 then for _, connection in ipairs(connections) do pcall(function() connection:Fire() end) end return true end return false end task.spawn(function() while isRunning do pcall(function() if roundResult.Visible then clickPrimaryAction() task.wait(0.1) else revealSafeTiles() task.wait(0.1) end end) task.wait(0.05) end end) UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.F4 then isRunning = not isRunning if isRunning then task.spawn(function() while isRunning do pcall(function() if roundResult.Visible then clickPrimaryAction() task.wait(0.1) else revealSafeTiles() task.wait(0.1) end end) task.wait(0.05) end end) else end end end)