Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- AUTO FARM ESPECÍFICO PARA DUNGEON HEROES
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local VirtualInputManager = game:GetService("VirtualInputManager")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local player = Players.LocalPlayer
- local farmActive = false
- -- CONFIGURAÇÕES ESPECÍFICAS DO DUNGEON HEROES
- local farmSettings = {
- clickSpeed = 0.2,
- teleportOffset = CFrame.new(0, 0, 5),
- attackRange = 50
- }
- print("=== DUNGEON HEROES FARM CARREGADO ===")
- -- MÉTODO 1: AUTO CLIQUE MELHORADO (ESPECÍFICO PARA DUNGEON HEROES)
- local function autoClickDungeon()
- spawn(function()
- while farmActive do
- -- Método 1: Mouse básico
- pcall(function()
- local mouse = player:GetMouse()
- mouse.Button1Down:Fire()
- wait(0.05)
- mouse.Button1Up:Fire()
- end)
- -- Método 2: VirtualInputManager
- pcall(function()
- VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 1)
- wait(0.05)
- VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 1)
- end)
- -- Método 3: Teclas de ataque do Dungeon Heroes
- pcall(function()
- VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Q, false, game)
- wait(0.05)
- VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Q, false, game)
- end)
- wait(farmSettings.clickSpeed)
- end
- end)
- end
- -- MÉTODO 2: FARM DE MONSTROS (VERSÃO MELHORADA PARA DUNGEON HEROES)
- local function findDungeonEnemies()
- local character = player.Character
- if not character or not character:FindFirstChild("HumanoidRootPart") then
- print("Sem personagem ou HumanoidRootPart")
- return nil
- end
- local myPosition = character.HumanoidRootPart.Position
- local nearestEnemy = nil
- local shortestDistance = 200 -- Aumentar alcance
- print("Procurando inimigos...")
- -- MÉTODO MAIS AMPLO - procurar em TUDO
- for _, obj in pairs(workspace:GetDescendants()) do
- if obj:IsA("Model") and obj ~= character and obj.Parent ~= Players then
- local humanoid = obj:FindFirstChild("Humanoid")
- local rootPart = obj:FindFirstChild("HumanoidRootPart") or obj:FindFirstChild("Torso") or obj:FindFirstChild("Head")
- if humanoid and rootPart and humanoid.Health > 0 and humanoid.MaxHealth > 0 then
- -- Verificar se NÃO é jogador
- local isPlayer = false
- for _, p in pairs(Players:GetPlayers()) do
- if p.Character == obj then
- isPlayer = true
- break
- end
- end
- -- Verificar nomes típicos de inimigos do Dungeon Heroes
- local enemyNames = {"goblin", "skeleton", "orc", "spider", "bandit", "slime", "wolf", "bat", "zombie"}
- local isEnemy = false
- for _, enemyName in pairs(enemyNames) do
- if string.find(obj.Name:lower(), enemyName) then
- isEnemy = true
- break
- end
- end
- if not isPlayer and (isEnemy or humanoid.MaxHealth < 1000) then -- NPCs geralmente têm menos HP
- local distance = (myPosition - rootPart.Position).Magnitude
- if distance < shortestDistance then
- shortestDistance = distance
- nearestEnemy = obj
- print("Inimigo encontrado: " .. obj.Name .. " | Distância: " .. math.floor(distance))
- end
- end
- end
- end
- end
- return nearestEnemy, shortestDistance
- end
- local function farmDungeonEnemies()
- spawn(function()
- while farmActive do
- print("Procurando inimigos...")
- local enemy, distance = findDungeonEnemies()
- if enemy then
- print("Inimigo encontrado: " .. enemy.Name .. " | Distância: " .. math.floor(distance))
- local character = player.Character
- if character and character:FindFirstChild("HumanoidRootPart") then
- local enemyPart = enemy:FindFirstChild("HumanoidRootPart") or enemy:FindFirstChild("Torso") or enemy:FindFirstChild("Head")
- if enemyPart then
- -- Teleportar mais próximo
- local teleportCFrame = enemyPart.CFrame * CFrame.new(math.random(-3,3), 0, math.random(-3,3))
- character.HumanoidRootPart.CFrame = teleportCFrame
- wait(0.5) -- Esperar um pouco mais após teleport
- print("Teleportado para: " .. enemy.Name .. " | Atacando...")
- -- Atacar usando o mesmo método do auto click que funciona
- for i = 1, 8 do -- Mais ataques
- pcall(function()
- local mouse = player:GetMouse()
- mouse.Button1Down:Fire()
- wait(0.05)
- mouse.Button1Up:Fire()
- end)
- pcall(function()
- VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 1)
- wait(0.05)
- VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 1)
- end)
- wait(0.15)
- end
- wait(0.5) -- Esperar antes de procurar próximo
- end
- end
- else
- print("Nenhum inimigo encontrado - expandindo busca...")
- -- Listar alguns objetos para debug
- local count = 0
- for _, obj in pairs(workspace:GetChildren()) do
- if obj:IsA("Model") and count < 5 then
- local humanoid = obj:FindFirstChild("Humanoid")
- if humanoid then
- print("Modelo com humanoid: " .. obj.Name .. " | HP: " .. humanoid.Health .. "/" .. humanoid.MaxHealth)
- count = count + 1
- end
- end
- end
- end
- wait(2) -- Esperar mais entre buscas
- end
- end)
- end
- -- MÉTODO 3: FARM USANDO REMOTES (DUNGEON HEROES ESPECÍFICO)
- local remoteFarmActive = false
- local function hookDungeonRemotes()
- local remotes = {}
- -- Procurar por remotes de ataque
- pcall(function()
- for _, remote in pairs(ReplicatedStorage:GetDescendants()) do
- if remote:IsA("RemoteEvent") or remote:IsA("RemoteFunction") then
- local name = remote.Name:lower()
- if name:find("attack") or name:find("damage") or name:find("hit") or name:find("skill") then
- table.insert(remotes, remote)
- end
- end
- end
- end)
- return remotes
- end
- local function farmWithRemotes()
- spawn(function()
- local attackRemotes = hookDungeonRemotes()
- while remoteFarmActive do
- for _, remote in pairs(attackRemotes) do
- pcall(function()
- if remote:IsA("RemoteEvent") then
- remote:FireServer()
- end
- end)
- wait(0.1)
- end
- wait(farmSettings.clickSpeed)
- end
- end)
- end
- -- GUI SIMPLES PARA DUNGEON HEROES
- local screenGui = Instance.new("ScreenGui")
- screenGui.Parent = player.PlayerGui
- screenGui.ResetOnSpawn = false
- screenGui.Name = "DungeonHeroesFarm"
- local frame = Instance.new("Frame")
- frame.Parent = screenGui
- frame.Size = UDim2.new(0, 180, 0, 220)
- frame.Position = UDim2.new(0, 10, 0.5, -110)
- frame.BackgroundColor3 = Color3.new(0, 0, 0)
- frame.BackgroundTransparency = 0.3
- frame.BorderSizePixel = 2
- frame.BorderColor3 = Color3.new(1, 1, 1)
- frame.Active = true
- frame.Draggable = true
- local title = Instance.new("TextLabel")
- title.Parent = frame
- title.Size = UDim2.new(1, 0, 0, 25)
- title.BackgroundTransparency = 1
- title.Text = "DUNGEON HEROES FARM"
- title.TextColor3 = Color3.new(1, 1, 1)
- title.TextSize = 12
- title.Font = Enum.Font.SourceSansBold
- -- Botões específicos para Dungeon Heroes
- local buttons = {
- {
- name = "Auto Click",
- func = function()
- farmActive = not farmActive
- if farmActive then
- print("Auto Click ON")
- autoClickDungeon()
- else
- print("Auto Click OFF")
- end
- end
- },
- {
- name = "Farm Enemies",
- func = function()
- farmActive = not farmActive
- if farmActive then
- print("Farm Enemies ON")
- farmDungeonEnemies()
- else
- print("Farm Enemies OFF")
- end
- end
- },
- {
- name = "Remote Farm",
- func = function()
- remoteFarmActive = not remoteFarmActive
- if remoteFarmActive then
- print("Remote Farm ON")
- farmWithRemotes()
- else
- print("Remote Farm OFF")
- end
- end
- },
- {
- name = "Stop All",
- func = function()
- farmActive = false
- remoteFarmActive = false
- print("All farms stopped")
- end
- },
- {
- name = "Debug Info",
- func = function()
- print("=== DEBUG DUNGEON HEROES ===")
- print("Player: " .. player.Name)
- print("Character: " .. tostring(player.Character))
- if player.Character then
- print("HumanoidRootPart: " .. tostring(player.Character:FindFirstChild("HumanoidRootPart")))
- if player.Character:FindFirstChild("HumanoidRootPart") then
- local pos = player.Character.HumanoidRootPart.Position
- print("Position: " .. math.floor(pos.X) .. ", " .. math.floor(pos.Y) .. ", " .. math.floor(pos.Z))
- end
- end
- print("Workspace children count: " .. #workspace:GetChildren())
- -- Procurar NPCs mais detalhadamente
- local models = {}
- local npcs = {}
- for _, obj in pairs(workspace:GetChildren()) do
- if obj:IsA("Model") then
- table.insert(models, obj.Name)
- local humanoid = obj:FindFirstChild("Humanoid")
- if humanoid and obj ~= player.Character then
- table.insert(npcs, obj.Name .. " (HP:" .. humanoid.Health .. "/" .. humanoid.MaxHealth .. ")")
- end
- end
- end
- print("Models found: " .. #models)
- if #models > 0 then
- print("First 10 models: " .. table.concat(models, ", ", 1, math.min(10, #models)))
- end
- print("NPCs with humanoid: " .. #npcs)
- if #npcs > 0 then
- print("NPCs: " .. table.concat(npcs, ", ", 1, math.min(5, #npcs)))
- end
- -- Verificar se ReplicatedStorage tem remotes
- local remoteCount = 0
- for _, obj in pairs(ReplicatedStorage:GetDescendants()) do
- if obj:IsA("RemoteEvent") or obj:IsA("RemoteFunction") then
- remoteCount = remoteCount + 1
- end
- end
- print("RemoteEvents/Functions found: " .. remoteCount)
- end
- }
- }
- for i, button in pairs(buttons) do
- local btn = Instance.new("TextButton")
- btn.Parent = frame
- btn.Size = UDim2.new(1, -10, 0, 30)
- btn.Position = UDim2.new(0, 5, 0, 30 + (i * 35))
- btn.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
- btn.BorderSizePixel = 1
- btn.BorderColor3 = Color3.new(0.5, 0.5, 0.5)
- btn.Text = button.name
- btn.TextColor3 = Color3.new(1, 1, 1)
- btn.TextSize = 11
- btn.Font = Enum.Font.SourceSans
- btn.MouseButton1Click:Connect(button.func)
- end
- -- Auto executar debug info
- wait(2)
- print("=== DUNGEON HEROES FARM LOADED ===")
- print("GUI available on left side")
- print("Click 'Debug Info' first to check setup")
- -- Verificação automática
- spawn(function()
- wait(3)
- if player.Character then
- print("Character detected: " .. player.Character.Name)
- else
- print("No character detected - try respawning")
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment