-- == SETUP ============================================== local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local StarterGui = game:GetService("StarterGui") local ReplicatedStorage = game:GetService("ReplicatedStorage") local player = Players.LocalPlayer -- == VARIABLES ========================================== local isTouching = false local autoFireEnabled = false local cooldownActive = false local currentRemote = nil local character = nil local patchLoopActive = false -- == FUNCTIONS (Defined before use) ===================== local function getSkillsModule() local mod = ReplicatedStorage:FindFirstChild("Assets1") if mod then mod = mod:FindFirstChild("Modules") if mod then mod = mod:FindFirstChild("Handler") if mod then mod = mod:FindFirstChild("AllCdSkills") if mod then local success, result = pcall(require, mod) if success and type(result) == "table" then return result end end end end end -- Safe fallback check with pcall local successGet, loadedMods = pcall(function() if getloadedmodules then return getloadedmodules() end end) if successGet and type(loadedMods) == "table" then for _, ms in ipairs(loadedMods) do if ms and ms.Name == "AllCdSkills" then local success, result = pcall(require, ms) if success and type(result) == "table" then return result end end end end return nil end local function patchSkills() local mod = getSkillsModule() if not mod then return false end local skills = nil local success, maybeSkills = pcall(function() return mod.Skills end) if success and type(maybeSkills) == "table" then skills = maybeSkills else for _, v in pairs(mod) do if type(v) == "table" then for _, item in pairs(v) do if type(item) == "table" and item.Cooldown ~= nil then skills = v break end end if skills then break end end end end if not skills then return false end for _, skill in pairs(skills) do if type(skill) == "table" and skill.Cooldown ~= nil then skill.Cooldown = 0.01 end end local successMeta, currentMt = pcall(getmetatable, skills) if not successMeta or not currentMt or not currentMt.__index then local mt = { __index = function(t, k) local raw = rawget(t, k) if not raw then raw = { Cooldown = 0.01 } rawset(t, k, raw) end if type(raw) == "table" and raw.Cooldown ~= nil then raw.Cooldown = 0.01 end return raw end } pcall(setmetatable, skills, mt) end return true end -- Replaced Heartbeat with a throttled loop to avoid anti-cheat crashing/detachment local function startCooldownPatcher() if patchLoopActive then return end patchLoopActive = true task.spawn(function() while cooldownActive do pcall(patchSkills) task.wait(1) -- Patches once every 1 second instead of 60 times a second end patchLoopActive = false end) end local function updateTool() currentRemote = nil if not character or not character.Parent then return end local tool = character:FindFirstChildWhichIsA("Tool") if not tool then return end local rctFolder = tool:FindFirstChild(tool.Name) or character:FindFirstChild(tool.Name) if not rctFolder then return end local localFolder = rctFolder:FindFirstChild("Local") if not localFolder then return end local eventSkill = localFolder:FindFirstChild("EventSkill") if eventSkill and eventSkill:IsA("RemoteEvent") then currentRemote = eventSkill end end -- == CREATE UI (all elements first) ===================== local screenGui = Instance.new("ScreenGui") screenGui.Name = "CooldownAutoGui" screenGui.ResetOnSpawn = false screenGui.Parent = player:WaitForChild("PlayerGui") local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 210, 0, 140) frame.Position = UDim2.new(0, 20, 0, 80) frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40) frame.BackgroundTransparency = 0.15 frame.BorderSizePixel = 2 frame.BorderColor3 = Color3.fromRGB(255, 255, 255) frame.Parent = screenGui -- == DRAGGABLE / DETACHABLE FRAME LOGIC ================= local dragging, dragInput, dragStart, startPos frame.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = frame.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) frame.InputChanged:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then dragInput = input end end) UserInputService.InputChanged:Connect(function(input) if input == dragInput and dragging then local delta = input.Position - dragStart frame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y) end end) local statusLabel = Instance.new("TextLabel") statusLabel.Size = UDim2.new(1, -10, 0, 30) statusLabel.Position = UDim2.new(0, 5, 0, 95) statusLabel.BackgroundColor3 = Color3.fromRGB(20, 20, 20) statusLabel.TextColor3 = Color3.fromRGB(255, 255, 255) statusLabel.Font = Enum.Font.GothamBold statusLabel.TextSize = 14 statusLabel.Text = "Cooldown: OFF | Auto: OFF" statusLabel.Parent = frame local function createButton(text, positionY) local btn = Instance.new("TextButton") btn.Size = UDim2.new(1, -20, 0, 30) btn.Position = UDim2.new(0, 10, 0, positionY) btn.Text = text btn.BackgroundColor3 = Color3.fromRGB(60, 60, 60) btn.TextColor3 = Color3.fromRGB(255, 255, 255) btn.BorderSizePixel = 1 btn.BorderColor3 = Color3.fromRGB(200, 200, 200) btn.Font = Enum.Font.GothamBold btn.TextSize = 16 btn.Parent = frame return btn end local cooldownBtn = createButton("Cooldown: OFF", 10) local autoBtn = createButton("Auto: OFF", 45) -- == ATTACH CLICK EVENTS =============================== cooldownBtn.MouseButton1Click:Connect(function() cooldownActive = not cooldownActive pcall(function() cooldownBtn.Text = cooldownActive and "Cooldown: ON" or "Cooldown: OFF" statusLabel.Text = string.format("Cooldown: %s | Auto: %s", cooldownActive and "ON" or "OFF", autoFireEnabled and "ON" or "OFF" ) end) if cooldownActive then pcall(patchSkills) startCooldownPatcher() pcall(function() StarterGui:SetCore("SendNotification", { Title = "Cooldown", Text = "ACTIVATED", Duration = 1.5 }) end) else patchLoopActive = false pcall(function() StarterGui:SetCore("SendNotification", { Title = "Cooldown", Text = "DEACTIVATED", Duration = 1.5 }) end) end end) autoBtn.MouseButton1Click:Connect(function() autoFireEnabled = not autoFireEnabled pcall(function() autoBtn.Text = autoFireEnabled and "Auto: ON" or "Auto: OFF" statusLabel.Text = string.format("Cooldown: %s | Auto: %s", cooldownActive and "ON" or "OFF", autoFireEnabled and "ON" or "OFF" ) end) pcall(function() StarterGui:SetCore("SendNotification", { Title = "Autofire", Text = autoFireEnabled and "ENABLED" or "DISABLED", Duration = 1.5 }) end) end) -- == AUTOFIRE – TOUCH DETECTION ========================== UserInputService.TouchStarted:Connect(function(input, gameProcessed) if gameProcessed then return end isTouching = true end) UserInputService.TouchEnded:Connect(function(input, gameProcessed) if gameProcessed then return end isTouching = false end) -- == CHARACTER / TOOL CONNECTIONS ====================== local function onCharacterAdded(newChar) character = newChar currentRemote = nil task.wait(0.15) updateTool() newChar.ChildAdded:Connect(function(child) if child:IsA("Tool") then task.delay(0.08, updateTool) end end) newChar.ChildRemoved:Connect(function(child) if child:IsA("Tool") then currentRemote = nil end end) end if player.Character then onCharacterAdded(player.Character) end player.CharacterAdded:Connect(onCharacterAdded) -- == MAIN LOOP – FIRE ON TOUCH =========================== local fireCooldown = 0 RunService.Heartbeat:Connect(function(dt) if autoFireEnabled and isTouching and currentRemote then fireCooldown = fireCooldown + dt if fireCooldown >= 0.15 then -- Slightly increased delay to avoid network rate-limit kick/detachment fireCooldown = 0 pcall(function() currentRemote:FireServer() end) end end end) -- == STARTUP NOTIFICATION ================================ pcall(function() StarterGui:SetCore("SendNotification", { Title = "Mobile Script Loaded", Text = "Tap buttons to toggle", Duration = 3 }) end)