CheatyBlack

Untitled

Apr 14th, 2025
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.61 KB | None | 0 0
  1. -- Script de Combate Automático para Roblox
  2. -- Funcionalidades: Flutuar ao redor dos mobs, Auto Attack e Auto Skill
  3.  
  4. local player = game:GetService("Players").LocalPlayer
  5. local character = player.Character or player.CharacterAdded:Wait()
  6. local humanoid = character:WaitForChild("Humanoid")
  7. local playerRoot = character:WaitForChild("HumanoidRootPart")
  8. local mouse = player:GetMouse()
  9. local UserInputService = game:GetService("UserInputService")
  10. local RunService = game:GetService("RunService")
  11.  
  12. -- Interface GUI
  13. local ScreenGui = Instance.new("ScreenGui")
  14. ScreenGui.Parent = player.PlayerGui
  15. ScreenGui.ResetOnSpawn = false
  16.  
  17. local Frame = Instance.new("Frame")
  18. Frame.Size = UDim2.new(0, 200, 0, 150)
  19. Frame.Position = UDim2.new(0.8, 0, 0.3, 0)
  20. Frame.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
  21. Frame.BackgroundTransparency = 0.3
  22. Frame.BorderSizePixel = 2
  23. Frame.BorderColor3 = Color3.fromRGB(255, 255, 255)
  24. Frame.Parent = ScreenGui
  25.  
  26. local Title = Instance.new("TextLabel")
  27. Title.Size = UDim2.new(1, 0, 0, 30)
  28. Title.Text = "Combat Helper"
  29. Title.TextColor3 = Color3.fromRGB(255, 255, 255)
  30. Title.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
  31. Title.BorderSizePixel = 0
  32. Title.Font = Enum.Font.SourceSansBold
  33. Title.TextSize = 18
  34. Title.Parent = Frame
  35.  
  36. -- Função para criar checkboxes
  37. local function createCheckbox(name, positionY)
  38. local checkboxFrame = Instance.new("Frame")
  39. checkboxFrame.Size = UDim2.new(1, 0, 0, 30)
  40. checkboxFrame.Position = UDim2.new(0, 0, 0, positionY)
  41. checkboxFrame.BackgroundTransparency = 1
  42. checkboxFrame.Parent = Frame
  43.  
  44. local label = Instance.new("TextLabel")
  45. label.Size = UDim2.new(0.7, 0, 1, 0)
  46. label.Position = UDim2.new(0, 10, 0, 0)
  47. label.BackgroundTransparency = 1
  48. label.Text = name
  49. label.TextColor3 = Color3.fromRGB(255, 255, 255)
  50. label.Font = Enum.Font.SourceSans
  51. label.TextSize = 16
  52. label.TextXAlignment = Enum.TextXAlignment.Left
  53. label.Parent = checkboxFrame
  54.  
  55. local checkbox = Instance.new("Frame")
  56. checkbox.Size = UDim2.new(0, 20, 0, 20)
  57. checkbox.Position = UDim2.new(0.85, 0, 0.5, -10)
  58. checkbox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  59. checkbox.BorderColor3 = Color3.fromRGB(255, 255, 255)
  60. checkbox.Parent = checkboxFrame
  61.  
  62. local checked = Instance.new("Frame")
  63. checked.Size = UDim2.new(0.8, 0, 0.8, 0)
  64. checked.Position = UDim2.new(0.1, 0, 0.1, 0)
  65. checked.BackgroundColor3 = Color3.fromRGB(0, 255, 100)
  66. checked.BorderSizePixel = 0
  67. checked.Visible = false
  68. checked.Parent = checkbox
  69.  
  70. local button = Instance.new("TextButton")
  71. button.Size = UDim2.new(1, 0, 1, 0)
  72. button.BackgroundTransparency = 1
  73. button.Text = ""
  74. button.Parent = checkbox
  75.  
  76. local enabled = false
  77.  
  78. button.MouseButton1Click:Connect(function()
  79. enabled = not enabled
  80. checked.Visible = enabled
  81. end)
  82.  
  83. return enabled, button, function() return enabled end
  84. end
  85.  
  86. -- Criar checkboxes para cada função
  87. local _, _, isFloatEnabled = createCheckbox("Flutuar atrás do Mob", 30)
  88. local _, _, isAutoAttackEnabled = createCheckbox("Auto Attack", 60)
  89. local _, _, isAutoSkillEnabled = createCheckbox("Auto Skill", 90)
  90.  
  91. -- Função para encontrar o mob mais próximo
  92. local function findNearestMob()
  93. local nearestMob = nil
  94. local minDistance = math.huge
  95. local maxDistance = 100 -- Distância máxima para detecção de mobs
  96.  
  97. for _, v in pairs(workspace:GetDescendants()) do
  98. if v:IsA("Model") and v:FindFirstChild("Humanoid") and v:FindFirstChild("HumanoidRootPart") then
  99. if v ~= character and v.Humanoid.Health > 0 then
  100. local distance = (playerRoot.Position - v.HumanoidRootPart.Position).Magnitude
  101. if distance < minDistance and distance < maxDistance then
  102. nearestMob = v
  103. minDistance = distance
  104. end
  105. end
  106. end
  107. end
  108.  
  109. return nearestMob
  110. end
  111.  
  112. -- Função para flutuar atrás do mob
  113. local function floatBehindMob(mob)
  114. if not mob or not mob:FindFirstChild("HumanoidRootPart") then return end
  115.  
  116. local mobRoot = mob.HumanoidRootPart
  117. local mobLookVector = mobRoot.CFrame.LookVector
  118.  
  119. -- Posição atrás do mob (costas)
  120. local behindPosition = mobRoot.Position - (mobLookVector * 5)
  121. behindPosition = behindPosition + Vector3.new(0, 3, 0) -- Flutuar um pouco acima
  122.  
  123. -- Mover o personagem para essa posição
  124. playerRoot.CFrame = CFrame.new(behindPosition, mobRoot.Position)
  125. end
  126.  
  127. -- Função para simular um ataque
  128. local function attack()
  129. local attackEvent = player.Character:FindFirstChild("Attack")
  130.  
  131. if attackEvent and attackEvent:IsA("RemoteEvent") then
  132. attackEvent:FireServer()
  133. else
  134. -- Método genérico se não encontrar um evento de ataque específico
  135. mouse1click() -- Simula um clique do mouse
  136. end
  137. end
  138.  
  139. -- Função para usar habilidades
  140. local function useSkill(key)
  141. -- Simula pressionar uma tecla
  142. local virtualInputManager = game:GetService("VirtualInputManager")
  143. virtualInputManager:SendKeyEvent(true, Enum.KeyCode[key], false, game)
  144. wait(0.1)
  145. virtualInputManager:SendKeyEvent(false, Enum.KeyCode[key], false, game)
  146. end
  147.  
  148. -- Loop principal
  149. RunService:BindToRenderStep("CombatHelper", Enum.RenderPriority.Character.Value, function()
  150. local mob = findNearestMob()
  151.  
  152. if not mob then return end
  153.  
  154. -- Verificar se o mob está ao alcance
  155. local distance = (playerRoot.Position - mob.HumanoidRootPart.Position).Magnitude
  156. local maxAttackDistance = 30 -- Alcance de ataque estendido
  157.  
  158. if isFloatEnabled() and mob then
  159. floatBehindMob(mob)
  160. end
  161.  
  162. if isAutoAttackEnabled() and distance <= maxAttackDistance then
  163. attack()
  164. end
  165.  
  166. if isAutoSkillEnabled() then
  167. -- Usar habilidades periodicamente se estiver perto do mob
  168. if distance <= maxAttackDistance then
  169. -- Contador para controlar o uso de habilidades
  170. if not _G.skillTimer then
  171. _G.skillTimer = 0
  172. _G.lastSkillUsed = nil
  173. end
  174.  
  175. _G.skillTimer = _G.skillTimer + 1
  176.  
  177. -- Usar habilidades em sequência a cada 30 frames (aproximadamente 0.5 segundos)
  178. if _G.skillTimer >= 30 then
  179. _G.skillTimer = 0
  180.  
  181. if _G.lastSkillUsed == nil or _G.lastSkillUsed == "1" then
  182. useSkill("R")
  183. _G.lastSkillUsed = "R"
  184. elseif _G.lastSkillUsed == "R" then
  185. useSkill("F")
  186. _G.lastSkillUsed = "F"
  187. elseif _G.lastSkillUsed == "F" then
  188. useSkill("X")
  189. _G.lastSkillUsed = "X"
  190. elseif _G.lastSkillUsed == "X" then
  191. useSkill("One")
  192. _G.lastSkillUsed = "1"
  193. end
  194. end
  195. end
  196. end
  197. end)
  198.  
  199. -- Adicionar um botão para arrastar a interface
  200. local dragButton = Instance.new("TextButton")
  201. dragButton.Text = "="
  202. dragButton.Position = UDim2.new(0, 0, 0, 0)
  203. dragButton.Size = UDim2.new(0, 30, 0, 30)
  204. dragButton.BackgroundTransparency = 0.5
  205. dragButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  206. dragButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  207. dragButton.Parent = Frame
  208.  
  209. -- Função para permitir arrastar a interface
  210. local dragging
  211. local dragInput
  212. local dragStart
  213. local startPos
  214.  
  215. dragButton.InputBegan:Connect(function(input)
  216. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  217. dragging = true
  218. dragStart = input.Position
  219. startPos = Frame.Position
  220. end
  221. end)
  222.  
  223. dragButton.InputEnded:Connect(function(input)
  224. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  225. dragging = false
  226. end
  227. end)
  228.  
  229. UserInputService.InputChanged:Connect(function(input)
  230. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  231. dragInput = input
  232. end
  233. end)
  234.  
  235. RunService.RenderStepped:Connect(function()
  236. if dragging and dragInput then
  237. local delta = dragInput.Position - dragStart
  238. Frame.Position = UDim2.new(
  239. startPos.X.Scale,
  240. startPos.X.Offset + delta.X,
  241. startPos.Y.Scale,
  242. startPos.Y.Offset + delta.Y
  243. )
  244. end
  245. end)
  246.  
  247. -- Mensagem de confirmação no console
  248. print("Script de Combate Automático carregado!")
  249. print("Instruções: Ative os checkboxes para habilitar as funções")
Advertisement
Add Comment
Please, Sign In to add comment