Slzintv

Untitled

Jul 19th, 2025 (edited)
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 13.15 KB | Gaming | 0 0
  1. -- AUTO FARM ESPECÍFICO PARA DUNGEON HEROES
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local VirtualInputManager = game:GetService("VirtualInputManager")
  5. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  6.  
  7. local player = Players.LocalPlayer
  8. local farmActive = false
  9.  
  10. -- CONFIGURAÇÕES ESPECÍFICAS DO DUNGEON HEROES
  11. local farmSettings = {
  12.     clickSpeed = 0.2,
  13.     teleportOffset = CFrame.new(0, 0, 5),
  14.     attackRange = 50
  15. }
  16.  
  17. print("=== DUNGEON HEROES FARM CARREGADO ===")
  18.  
  19. -- MÉTODO 1: AUTO CLIQUE MELHORADO (ESPECÍFICO PARA DUNGEON HEROES)
  20. local function autoClickDungeon()
  21.     spawn(function()
  22.         while farmActive do
  23.             -- Método 1: Mouse básico
  24.             pcall(function()
  25.                 local mouse = player:GetMouse()
  26.                 mouse.Button1Down:Fire()
  27.                 wait(0.05)
  28.                 mouse.Button1Up:Fire()
  29.             end)
  30.            
  31.             -- Método 2: VirtualInputManager
  32.             pcall(function()
  33.                 VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 1)
  34.                 wait(0.05)
  35.                 VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 1)
  36.             end)
  37.            
  38.             -- Método 3: Teclas de ataque do Dungeon Heroes
  39.             pcall(function()
  40.                 VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.Q, false, game)
  41.                 wait(0.05)
  42.                 VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.Q, false, game)
  43.             end)
  44.            
  45.             wait(farmSettings.clickSpeed)
  46.         end
  47.     end)
  48. end
  49.  
  50. -- MÉTODO 2: FARM DE MONSTROS (VERSÃO MELHORADA PARA DUNGEON HEROES)
  51. local function findDungeonEnemies()
  52.     local character = player.Character
  53.     if not character or not character:FindFirstChild("HumanoidRootPart") then
  54.         print("Sem personagem ou HumanoidRootPart")
  55.         return nil
  56.     end
  57.    
  58.     local myPosition = character.HumanoidRootPart.Position
  59.     local nearestEnemy = nil
  60.     local shortestDistance = 200 -- Aumentar alcance
  61.    
  62.     print("Procurando inimigos...")
  63.    
  64.     -- MÉTODO MAIS AMPLO - procurar em TUDO
  65.     for _, obj in pairs(workspace:GetDescendants()) do
  66.         if obj:IsA("Model") and obj ~= character and obj.Parent ~= Players then
  67.             local humanoid = obj:FindFirstChild("Humanoid")
  68.             local rootPart = obj:FindFirstChild("HumanoidRootPart") or obj:FindFirstChild("Torso") or obj:FindFirstChild("Head")
  69.            
  70.             if humanoid and rootPart and humanoid.Health > 0 and humanoid.MaxHealth > 0 then
  71.                 -- Verificar se NÃO é jogador
  72.                 local isPlayer = false
  73.                 for _, p in pairs(Players:GetPlayers()) do
  74.                     if p.Character == obj then
  75.                         isPlayer = true
  76.                         break
  77.                     end
  78.                 end
  79.                
  80.                 -- Verificar nomes típicos de inimigos do Dungeon Heroes
  81.                 local enemyNames = {"goblin", "skeleton", "orc", "spider", "bandit", "slime", "wolf", "bat", "zombie"}
  82.                 local isEnemy = false
  83.                 for _, enemyName in pairs(enemyNames) do
  84.                     if string.find(obj.Name:lower(), enemyName) then
  85.                         isEnemy = true
  86.                         break
  87.                     end
  88.                 end
  89.                
  90.                 if not isPlayer and (isEnemy or humanoid.MaxHealth < 1000) then -- NPCs geralmente têm menos HP
  91.                     local distance = (myPosition - rootPart.Position).Magnitude
  92.                     if distance < shortestDistance then
  93.                         shortestDistance = distance
  94.                         nearestEnemy = obj
  95.                         print("Inimigo encontrado: " .. obj.Name .. " | Distância: " .. math.floor(distance))
  96.                     end
  97.                 end
  98.             end
  99.         end
  100.     end
  101.    
  102.     return nearestEnemy, shortestDistance
  103. end
  104.  
  105. local function farmDungeonEnemies()
  106.     spawn(function()
  107.         while farmActive do
  108.             print("Procurando inimigos...")
  109.             local enemy, distance = findDungeonEnemies()
  110.            
  111.             if enemy then
  112.                 print("Inimigo encontrado: " .. enemy.Name .. " | Distância: " .. math.floor(distance))
  113.                
  114.                 local character = player.Character
  115.                 if character and character:FindFirstChild("HumanoidRootPart") then
  116.                     local enemyPart = enemy:FindFirstChild("HumanoidRootPart") or enemy:FindFirstChild("Torso") or enemy:FindFirstChild("Head")
  117.                    
  118.                     if enemyPart then
  119.                         -- Teleportar mais próximo
  120.                         local teleportCFrame = enemyPart.CFrame * CFrame.new(math.random(-3,3), 0, math.random(-3,3))
  121.                         character.HumanoidRootPart.CFrame = teleportCFrame
  122.                         wait(0.5) -- Esperar um pouco mais após teleport
  123.                        
  124.                         print("Teleportado para: " .. enemy.Name .. " | Atacando...")
  125.                        
  126.                         -- Atacar usando o mesmo método do auto click que funciona
  127.                         for i = 1, 8 do -- Mais ataques
  128.                             pcall(function()
  129.                                 local mouse = player:GetMouse()
  130.                                 mouse.Button1Down:Fire()
  131.                                 wait(0.05)
  132.                                 mouse.Button1Up:Fire()
  133.                             end)
  134.                            
  135.                             pcall(function()
  136.                                 VirtualInputManager:SendMouseButtonEvent(0, 0, 0, true, game, 1)
  137.                                 wait(0.05)
  138.                                 VirtualInputManager:SendMouseButtonEvent(0, 0, 0, false, game, 1)
  139.                             end)
  140.                            
  141.                             wait(0.15)
  142.                         end
  143.                        
  144.                         wait(0.5) -- Esperar antes de procurar próximo
  145.                     end
  146.                 end
  147.             else
  148.                 print("Nenhum inimigo encontrado - expandindo busca...")
  149.                 -- Listar alguns objetos para debug
  150.                 local count = 0
  151.                 for _, obj in pairs(workspace:GetChildren()) do
  152.                     if obj:IsA("Model") and count < 5 then
  153.                         local humanoid = obj:FindFirstChild("Humanoid")
  154.                         if humanoid then
  155.                             print("Modelo com humanoid: " .. obj.Name .. " | HP: " .. humanoid.Health .. "/" .. humanoid.MaxHealth)
  156.                             count = count + 1
  157.                         end
  158.                     end
  159.                 end
  160.             end
  161.            
  162.             wait(2) -- Esperar mais entre buscas
  163.         end
  164.     end)
  165. end
  166.  
  167. -- MÉTODO 3: FARM USANDO REMOTES (DUNGEON HEROES ESPECÍFICO)
  168. local remoteFarmActive = false
  169.  
  170. local function hookDungeonRemotes()
  171.     local remotes = {}
  172.    
  173.     -- Procurar por remotes de ataque
  174.     pcall(function()
  175.         for _, remote in pairs(ReplicatedStorage:GetDescendants()) do
  176.             if remote:IsA("RemoteEvent") or remote:IsA("RemoteFunction") then
  177.                 local name = remote.Name:lower()
  178.                 if name:find("attack") or name:find("damage") or name:find("hit") or name:find("skill") then
  179.                     table.insert(remotes, remote)
  180.                 end
  181.             end
  182.         end
  183.     end)
  184.    
  185.     return remotes
  186. end
  187.  
  188. local function farmWithRemotes()
  189.     spawn(function()
  190.         local attackRemotes = hookDungeonRemotes()
  191.        
  192.         while remoteFarmActive do
  193.             for _, remote in pairs(attackRemotes) do
  194.                 pcall(function()
  195.                     if remote:IsA("RemoteEvent") then
  196.                         remote:FireServer()
  197.                     end
  198.                 end)
  199.                 wait(0.1)
  200.             end
  201.             wait(farmSettings.clickSpeed)
  202.         end
  203.     end)
  204. end
  205.  
  206. -- GUI SIMPLES PARA DUNGEON HEROES
  207. local screenGui = Instance.new("ScreenGui")
  208. screenGui.Parent = player.PlayerGui
  209. screenGui.ResetOnSpawn = false
  210. screenGui.Name = "DungeonHeroesFarm"
  211.  
  212. local frame = Instance.new("Frame")
  213. frame.Parent = screenGui
  214. frame.Size = UDim2.new(0, 180, 0, 220)
  215. frame.Position = UDim2.new(0, 10, 0.5, -110)
  216. frame.BackgroundColor3 = Color3.new(0, 0, 0)
  217. frame.BackgroundTransparency = 0.3
  218. frame.BorderSizePixel = 2
  219. frame.BorderColor3 = Color3.new(1, 1, 1)
  220. frame.Active = true
  221. frame.Draggable = true
  222.  
  223. local title = Instance.new("TextLabel")
  224. title.Parent = frame
  225. title.Size = UDim2.new(1, 0, 0, 25)
  226. title.BackgroundTransparency = 1
  227. title.Text = "DUNGEON HEROES FARM"
  228. title.TextColor3 = Color3.new(1, 1, 1)
  229. title.TextSize = 12
  230. title.Font = Enum.Font.SourceSansBold
  231.  
  232. -- Botões específicos para Dungeon Heroes
  233. local buttons = {
  234.     {
  235.         name = "Auto Click",
  236.         func = function()
  237.             farmActive = not farmActive
  238.             if farmActive then
  239.                 print("Auto Click ON")
  240.                 autoClickDungeon()
  241.             else
  242.                 print("Auto Click OFF")
  243.             end
  244.         end
  245.     },
  246.     {
  247.         name = "Farm Enemies",
  248.         func = function()
  249.             farmActive = not farmActive
  250.             if farmActive then
  251.                 print("Farm Enemies ON")
  252.                 farmDungeonEnemies()
  253.             else
  254.                 print("Farm Enemies OFF")
  255.             end
  256.         end
  257.     },
  258.     {
  259.         name = "Remote Farm",
  260.         func = function()
  261.             remoteFarmActive = not remoteFarmActive
  262.             if remoteFarmActive then
  263.                 print("Remote Farm ON")
  264.                 farmWithRemotes()
  265.             else
  266.                 print("Remote Farm OFF")
  267.             end
  268.         end
  269.     },
  270.     {
  271.         name = "Stop All",
  272.         func = function()
  273.             farmActive = false
  274.             remoteFarmActive = false
  275.             print("All farms stopped")
  276.         end
  277.     },
  278.     {
  279.         name = "Debug Info",
  280.         func = function()
  281.             print("=== DEBUG DUNGEON HEROES ===")
  282.             print("Player: " .. player.Name)
  283.             print("Character: " .. tostring(player.Character))
  284.            
  285.             if player.Character then
  286.                 print("HumanoidRootPart: " .. tostring(player.Character:FindFirstChild("HumanoidRootPart")))
  287.                 if player.Character:FindFirstChild("HumanoidRootPart") then
  288.                     local pos = player.Character.HumanoidRootPart.Position
  289.                     print("Position: " .. math.floor(pos.X) .. ", " .. math.floor(pos.Y) .. ", " .. math.floor(pos.Z))
  290.                 end
  291.             end
  292.            
  293.             print("Workspace children count: " .. #workspace:GetChildren())
  294.            
  295.             -- Procurar NPCs mais detalhadamente
  296.             local models = {}
  297.             local npcs = {}
  298.            
  299.             for _, obj in pairs(workspace:GetChildren()) do
  300.                 if obj:IsA("Model") then
  301.                     table.insert(models, obj.Name)
  302.                     local humanoid = obj:FindFirstChild("Humanoid")
  303.                     if humanoid and obj ~= player.Character then
  304.                         table.insert(npcs, obj.Name .. " (HP:" .. humanoid.Health .. "/" .. humanoid.MaxHealth .. ")")
  305.                     end
  306.                 end
  307.             end
  308.            
  309.             print("Models found: " .. #models)
  310.             if #models > 0 then
  311.                 print("First 10 models: " .. table.concat(models, ", ", 1, math.min(10, #models)))
  312.             end
  313.            
  314.             print("NPCs with humanoid: " .. #npcs)
  315.             if #npcs > 0 then
  316.                 print("NPCs: " .. table.concat(npcs, ", ", 1, math.min(5, #npcs)))
  317.             end
  318.            
  319.             -- Verificar se ReplicatedStorage tem remotes
  320.             local remoteCount = 0
  321.             for _, obj in pairs(ReplicatedStorage:GetDescendants()) do
  322.                 if obj:IsA("RemoteEvent") or obj:IsA("RemoteFunction") then
  323.                     remoteCount = remoteCount + 1
  324.                 end
  325.             end
  326.             print("RemoteEvents/Functions found: " .. remoteCount)
  327.         end
  328.     }
  329. }
  330.  
  331. for i, button in pairs(buttons) do
  332.     local btn = Instance.new("TextButton")
  333.     btn.Parent = frame
  334.     btn.Size = UDim2.new(1, -10, 0, 30)
  335.     btn.Position = UDim2.new(0, 5, 0, 30 + (i * 35))
  336.     btn.BackgroundColor3 = Color3.new(0.2, 0.2, 0.2)
  337.     btn.BorderSizePixel = 1
  338.     btn.BorderColor3 = Color3.new(0.5, 0.5, 0.5)
  339.     btn.Text = button.name
  340.     btn.TextColor3 = Color3.new(1, 1, 1)
  341.     btn.TextSize = 11
  342.     btn.Font = Enum.Font.SourceSans
  343.    
  344.     btn.MouseButton1Click:Connect(button.func)
  345. end
  346.  
  347. -- Auto executar debug info
  348. wait(2)
  349. print("=== DUNGEON HEROES FARM LOADED ===")
  350. print("GUI available on left side")
  351. print("Click 'Debug Info' first to check setup")
  352.  
  353. -- Verificação automática
  354. spawn(function()
  355.     wait(3)
  356.     if player.Character then
  357.         print("Character detected: " .. player.Character.Name)
  358.     else
  359.         print("No character detected - try respawning")
  360.     end
  361. end)
Advertisement
Add Comment
Please, Sign In to add comment