Elisonpp

Aimlock

Aug 17th, 2025
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.47 KB | None | 0 0
  1. -- KRNL Mobile Combat Script
  2. -- Compatível com executores mobile
  3.  
  4. local Players = game:GetService("Players")
  5. local RunService = game:GetService("RunService")
  6. local UserInputService = game:GetService("UserInputService")
  7. local Workspace = game:GetService("Workspace")
  8. local Camera = Workspace.CurrentCamera
  9. local TweenService = game:GetService("TweenService")
  10.  
  11. local LocalPlayer = Players.LocalPlayer
  12. local Mouse = LocalPlayer:GetMouse()
  13.  
  14. -- Variáveis principais
  15. local GUI = nil
  16. local MainFrame = nil
  17. local LoadingFrame = nil
  18. local aimbotEnabled = false
  19. local currentTarget = nil
  20. local fovCircle = nil
  21. local connection = nil
  22. local guiVisible = false
  23.  
  24. -- Configurações
  25. local config = {
  26. fovSize = 150,
  27. aimSpeed = 0.2,
  28. wallCheck = true,
  29. rainbowSpeed = 2
  30. }
  31.  
  32. -- Função para criar efeito rainbow
  33. local function getRainbowColor(offset)
  34. local time = tick() * config.rainbowSpeed + (offset or 0)
  35. return Color3.fromHSV(time % 1, 1, 1)
  36. end
  37.  
  38. -- Função para verificar se o jogador está visível (sem paredes)
  39. local function isPlayerVisible(player)
  40. if not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then
  41. return false
  42. end
  43.  
  44. if not config.wallCheck then
  45. return true
  46. end
  47.  
  48. local character = player.Character
  49. local humanoidRootPart = character.HumanoidRootPart
  50. local head = character:FindFirstChild("Head")
  51.  
  52. if not head then
  53. return false
  54. end
  55.  
  56. local rayOrigin = Camera.CFrame.Position
  57. local rayDirection = (head.Position - rayOrigin).Unit * (head.Position - rayOrigin).Magnitude
  58.  
  59. local raycastParams = RaycastParams.new()
  60. raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
  61. raycastParams.FilterDescendantsInstances = {LocalPlayer.Character, character}
  62.  
  63. local raycastResult = Workspace:Raycast(rayOrigin, rayDirection, raycastParams)
  64.  
  65. return raycastResult == nil
  66. end
  67.  
  68. -- Função para obter o jogador mais próximo no FOV
  69. local function getClosestPlayerInFOV()
  70. local closestPlayer = nil
  71. local shortestDistance = math.huge
  72.  
  73. for _, player in pairs(Players:GetPlayers()) do
  74. if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
  75. local character = player.Character
  76. local humanoidRootPart = character.HumanoidRootPart
  77. local head = character:FindFirstChild("Head")
  78.  
  79. if head then
  80. local screenPosition, onScreen = Camera:WorldToScreenPoint(head.Position)
  81.  
  82. if onScreen then
  83. local mousePosition = Vector2.new(Mouse.X, Mouse.Y)
  84. local targetPosition = Vector2.new(screenPosition.X, screenPosition.Y)
  85. local distance = (mousePosition - targetPosition).Magnitude
  86.  
  87. if distance <= config.fovSize and distance < shortestDistance then
  88. if isPlayerVisible(player) then
  89. closestPlayer = player
  90. shortestDistance = distance
  91. end
  92. end
  93. end
  94. end
  95. end
  96. end
  97.  
  98. return closestPlayer
  99. end
  100.  
  101. -- Função para criar o círculo FOV
  102. local function createFOVCircle()
  103. if fovCircle then
  104. fovCircle:Remove()
  105. end
  106.  
  107. fovCircle = Drawing.new("Circle")
  108. fovCircle.Transparency = 0.7
  109. fovCircle.Thickness = 2
  110. fovCircle.Filled = false
  111. fovCircle.Radius = config.fovSize
  112. fovCircle.Visible = false
  113. end
  114.  
  115. -- Função para atualizar FOV
  116. local function updateFOV()
  117. if fovCircle and aimbotEnabled then
  118. fovCircle.Position = Vector2.new(Mouse.X, Mouse.Y)
  119. fovCircle.Color = getRainbowColor()
  120. fovCircle.Visible = true
  121. elseif fovCircle then
  122. fovCircle.Visible = false
  123. end
  124. end
  125.  
  126. -- Função principal do aimbot
  127. local function aimbot()
  128. if not aimbotEnabled then
  129. currentTarget = nil
  130. return
  131. end
  132.  
  133. local target = getClosestPlayerInFOV()
  134.  
  135. if target and target.Character and target.Character:FindFirstChild("Head") then
  136. currentTarget = target
  137. local head = target.Character.Head
  138. local targetPosition = head.Position
  139.  
  140. -- Suavizar o movimento da câmera
  141. local currentCFrame = Camera.CFrame
  142. local targetCFrame = CFrame.lookAt(currentCFrame.Position, targetPosition)
  143.  
  144. local tweenInfo = TweenInfo.new(config.aimSpeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  145. local tween = TweenService:Create(Camera, tweenInfo, {CFrame = targetCFrame})
  146. tween:Play()
  147. else
  148. currentTarget = nil
  149. end
  150. end
  151.  
  152. -- Função para criar a tela de loading
  153. local function createLoadingScreen()
  154. LoadingFrame = Instance.new("Frame")
  155. LoadingFrame.Size = UDim2.new(1, 0, 1, 0)
  156. LoadingFrame.Position = UDim2.new(0, 0, 0, 0)
  157. LoadingFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 25)
  158. LoadingFrame.BorderSizePixel = 0
  159. LoadingFrame.Parent = GUI
  160.  
  161. -- Título
  162. local titleLabel = Instance.new("TextLabel")
  163. titleLabel.Size = UDim2.new(0, 300, 0, 50)
  164. titleLabel.Position = UDim2.new(0.5, -150, 0.3, 0)
  165. titleLabel.BackgroundTransparency = 1
  166. titleLabel.Text = "COMBAT SCRIPT"
  167. titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  168. titleLabel.TextSize = 28
  169. titleLabel.Font = Enum.Font.GothamBold
  170. titleLabel.Parent = LoadingFrame
  171.  
  172. -- Barra de progresso fundo
  173. local progressBG = Instance.new("Frame")
  174. progressBG.Size = UDim2.new(0, 300, 0, 8)
  175. progressBG.Position = UDim2.new(0.5, -150, 0.5, 0)
  176. progressBG.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
  177. progressBG.BorderSizePixel = 0
  178. progressBG.Parent = LoadingFrame
  179.  
  180. -- Barra de progresso
  181. local progressBar = Instance.new("Frame")
  182. progressBar.Size = UDim2.new(0, 0, 1, 0)
  183. progressBar.Position = UDim2.new(0, 0, 0, 0)
  184. progressBar.BackgroundColor3 = Color3.fromRGB(0, 255, 127)
  185. progressBar.BorderSizePixel = 0
  186. progressBar.Parent = progressBG
  187.  
  188. -- Adicionar cantos arredondados
  189. local corner1 = Instance.new("UICorner")
  190. corner1.CornerRadius = UDim.new(0, 4)
  191. corner1.Parent = progressBG
  192.  
  193. local corner2 = Instance.new("UICorner")
  194. corner2.CornerRadius = UDim.new(0, 4)
  195. corner2.Parent = progressBar
  196.  
  197. -- Animação da barra de progresso
  198. local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  199. local tween = TweenService:Create(progressBar, tweenInfo, {Size = UDim2.new(1, 0, 1, 0)})
  200. tween:Play()
  201.  
  202. tween.Completed:Connect(function()
  203. wait(0.5)
  204. LoadingFrame:TweenSize(UDim2.new(1, 0, 0, 0), "Out", "Sine", 0.5, true)
  205. wait(0.5)
  206. LoadingFrame:Destroy()
  207. createMainInterface()
  208. end)
  209. end
  210.  
  211. -- Função para criar a interface principal
  212. local function createMainInterface()
  213. -- Frame principal
  214. MainFrame = Instance.new("Frame")
  215. MainFrame.Size = UDim2.new(0, 400, 0, 300)
  216. MainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
  217. MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
  218. MainFrame.BorderSizePixel = 0
  219. MainFrame.Active = true
  220. MainFrame.Draggable = true
  221. MainFrame.Parent = GUI
  222.  
  223. -- Cantos arredondados
  224. local corner = Instance.new("UICorner")
  225. corner.CornerRadius = UDim.new(0, 12)
  226. corner.Parent = MainFrame
  227.  
  228. -- Header
  229. local header = Instance.new("Frame")
  230. header.Size = UDim2.new(1, 0, 0, 40)
  231. header.Position = UDim2.new(0, 0, 0, 0)
  232. header.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
  233. header.BorderSizePixel = 0
  234. header.Parent = MainFrame
  235.  
  236. local headerCorner = Instance.new("UICorner")
  237. headerCorner.CornerRadius = UDim.new(0, 12)
  238. headerCorner.Parent = header
  239.  
  240. -- Título do header
  241. local headerTitle = Instance.new("TextLabel")
  242. headerTitle.Size = UDim2.new(1, -20, 1, 0)
  243. headerTitle.Position = UDim2.new(0, 20, 0, 0)
  244. headerTitle.BackgroundTransparency = 1
  245. headerTitle.Text = "Combat Script v1.0"
  246. headerTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
  247. headerTitle.TextSize = 16
  248. headerTitle.Font = Enum.Font.GothamBold
  249. headerTitle.TextXAlignment = Enum.TextXAlignment.Left
  250. headerTitle.Parent = header
  251.  
  252. -- Botão de fechar
  253. local closeButton = Instance.new("TextButton")
  254. closeButton.Size = UDim2.new(0, 30, 0, 30)
  255. closeButton.Position = UDim2.new(1, -35, 0, 5)
  256. closeButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
  257. closeButton.BorderSizePixel = 0
  258. closeButton.Text = "×"
  259. closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  260. closeButton.TextSize = 18
  261. closeButton.Font = Enum.Font.GothamBold
  262. closeButton.Parent = header
  263.  
  264. local closeCorner = Instance.new("UICorner")
  265. closeCorner.CornerRadius = UDim.new(0, 15)
  266. closeCorner.Parent = closeButton
  267.  
  268. -- Tab Combat
  269. local combatTab = Instance.new("Frame")
  270. combatTab.Size = UDim2.new(1, -20, 1, -60)
  271. combatTab.Position = UDim2.new(0, 10, 0, 50)
  272. combatTab.BackgroundTransparency = 1
  273. combatTab.Parent = MainFrame
  274.  
  275. -- Toggle do Aimbot
  276. local aimbotToggle = Instance.new("Frame")
  277. aimbotToggle.Size = UDim2.new(1, 0, 0, 50)
  278. aimbotToggle.Position = UDim2.new(0, 0, 0, 20)
  279. aimbotToggle.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
  280. aimbotToggle.BorderSizePixel = 0
  281. aimbotToggle.Parent = combatTab
  282.  
  283. local toggleCorner = Instance.new("UICorner")
  284. toggleCorner.CornerRadius = UDim.new(0, 8)
  285. toggleCorner.Parent = aimbotToggle
  286.  
  287. local toggleLabel = Instance.new("TextLabel")
  288. toggleLabel.Size = UDim2.new(1, -60, 1, 0)
  289. toggleLabel.Position = UDim2.new(0, 15, 0, 0)
  290. toggleLabel.BackgroundTransparency = 1
  291. toggleLabel.Text = "Aimbot com FOV Rainbow"
  292. toggleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
  293. toggleLabel.TextSize = 14
  294. toggleLabel.Font = Enum.Font.Gotham
  295. toggleLabel.TextXAlignment = Enum.TextXAlignment.Left
  296. toggleLabel.Parent = aimbotToggle
  297.  
  298. local toggleButton = Instance.new("TextButton")
  299. toggleButton.Size = UDim2.new(0, 45, 0, 25)
  300. toggleButton.Position = UDim2.new(1, -55, 0.5, -12.5)
  301. toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 65)
  302. toggleButton.BorderSizePixel = 0
  303. toggleButton.Text = ""
  304. toggleButton.Parent = aimbotToggle
  305.  
  306. local buttonCorner = Instance.new("UICorner")
  307. buttonCorner.CornerRadius = UDim.new(0, 12.5)
  308. buttonCorner.Parent = toggleButton
  309.  
  310. local toggleIndicator = Instance.new("Frame")
  311. toggleIndicator.Size = UDim2.new(0, 21, 0, 21)
  312. toggleIndicator.Position = UDim2.new(0, 2, 0, 2)
  313. toggleIndicator.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
  314. toggleIndicator.BorderSizePixel = 0
  315. toggleIndicator.Parent = toggleButton
  316.  
  317. local indicatorCorner = Instance.new("UICorner")
  318. indicatorCorner.CornerRadius = UDim.new(0, 10.5)
  319. indicatorCorner.Parent = toggleIndicator
  320.  
  321. -- Função do toggle
  322. local function toggleAimbot()
  323. aimbotEnabled = not aimbotEnabled
  324.  
  325. if aimbotEnabled then
  326. toggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 127)
  327. toggleIndicator:TweenPosition(UDim2.new(1, -23, 0, 2), "Out", "Sine", 0.2, true)
  328. else
  329. toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 65)
  330. toggleIndicator:TweenPosition(UDim2.new(0, 2, 0, 2), "Out", "Sine", 0.2, true)
  331. end
  332. end
  333.  
  334. toggleButton.MouseButton1Click:Connect(toggleAimbot)
  335.  
  336. closeButton.MouseButton1Click:Connect(function()
  337. guiVisible = false
  338. MainFrame:TweenSize(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, true)
  339. wait(0.3)
  340. GUI.Enabled = false
  341. end)
  342. end
  343.  
  344. -- Função para criar a GUI principal
  345. local function createGUI()
  346. GUI = Instance.new("ScreenGui")
  347. GUI.Name = "CombatScript"
  348. GUI.Parent = game.CoreGui
  349. GUI.ResetOnSpawn = false
  350.  
  351. createLoadingScreen()
  352. createFOVCircle()
  353. end
  354.  
  355. -- Função para toggle da interface
  356. local function toggleGUI()
  357. if not GUI then
  358. createGUI()
  359. guiVisible = true
  360. return
  361. end
  362.  
  363. if guiVisible then
  364. guiVisible = false
  365. if MainFrame then
  366. MainFrame:TweenSize(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, true)
  367. wait(0.3)
  368. end
  369. GUI.Enabled = false
  370. else
  371. guiVisible = true
  372. GUI.Enabled = true
  373. if MainFrame then
  374. MainFrame.Size = UDim2.new(0, 0, 0, 0)
  375. MainFrame:TweenSize(UDim2.new(0, 400, 0, 300), "Out", "Back", 0.3, true)
  376. end
  377. end
  378. end
  379.  
  380. -- Conexões principais
  381. UserInputService.InputBegan:Connect(function(input, gameProcessed)
  382. if gameProcessed then return end
  383.  
  384. -- Toggle GUI com Insert ou RightShift (para mobile use touch)
  385. if input.KeyCode == Enum.KeyCode.Insert or input.KeyCode == Enum.KeyCode.RightShift then
  386. toggleGUI()
  387. end
  388. end)
  389.  
  390. -- Loop principal
  391. connection = RunService.Heartbeat:Connect(function()
  392. updateFOV()
  393. aimbot()
  394. end)
  395.  
  396. -- Inicialização
  397. createGUI()
  398.  
  399. print("Combat Script carregado com sucesso!")
  400. print("Pressione INSERT ou RightShift para abrir/fechar a interface")
  401. print("Funcionalidades:")
  402. print("- FOV Rainbow com detecção de jogadores")
  403. print("- Aimbot suave com verificação de visibilidade")
  404. print("- Interface moderna e responsiva")
  405. print("- Compatível com KRNL Mobil")
  406.  
  407. -- Botão Toggle flutuante que chama a mesma ação do RightShift
  408. -- Coloque este script como LocalScript (p.ex. StarterPlayerScripts)
  409.  
  410. local Players = game:GetService("Players")
  411. local UIS = game:GetService("UserInputService")
  412.  
  413. local player = Players.LocalPlayer
  414.  
  415. -- === FUNÇÃO QUE REPRESENTA "APERTAR RIGHTSHIFT" ===
  416. local function OnRightShiftAction()
  417. -- TODO: Coloque aqui o que você quer que aconteça quando "apertar RightShift"
  418. -- Exemplo: alternar visibilidade de uma UI
  419. print("Ação do RightShift executada!")
  420. end
  421.  
  422. -- === GUI ===
  423. local screenGui = Instance.new("ScreenGui")
  424. screenGui.Name = "ToggleRightShiftGUI"
  425. screenGui.ResetOnSpawn = false
  426. screenGui.IgnoreGuiInset = true
  427. screenGui.Parent = player:WaitForChild("PlayerGui")
  428.  
  429. local frame = Instance.new("Frame")
  430. frame.Size = UDim2.fromOffset(180, 56)
  431. frame.Position = UDim2.new(0, 30, 0.2, 0)
  432. frame.BackgroundColor3 = Color3.fromRGB(24, 24, 28)
  433. frame.BorderSizePixel = 0
  434. frame.Active = true -- necessário para arrastar
  435. frame.Parent = screenGui
  436.  
  437. -- cantos arredondados + borda sutil
  438. local corner = Instance.new("UICorner", frame)
  439. corner.CornerRadius = UDim.new(0, 14)
  440. local stroke = Instance.new("UIStroke", frame)
  441. stroke.Thickness = 1
  442. stroke.Transparency = 0.3
  443.  
  444. local title = Instance.new("TextLabel")
  445. title.Size = UDim2.new(1, -70, 1, 0)
  446. title.Position = UDim2.fromOffset(12, 0)
  447. title.BackgroundTransparency = 1
  448. title.Text = "RightShift"
  449. title.Font = Enum.Font.GothamSemibold
  450. title.TextScaled = true
  451. title.TextColor3 = Color3.fromRGB(235, 235, 240)
  452. title.TextXAlignment = Enum.TextXAlignment.Left
  453. title.Parent = frame
  454.  
  455. local toggle = Instance.new("TextButton")
  456. toggle.Size = UDim2.fromOffset(64, 36)
  457. toggle.Position = UDim2.new(1, -12 - 64, 0.5, -18)
  458. toggle.BackgroundColor3 = Color3.fromRGB(52, 211, 153) -- verde (ON) inicial
  459. toggle.AutoButtonColor = true
  460. toggle.Text = "ON"
  461. toggle.Font = Enum.Font.GothamBold
  462. toggle.TextScaled = true
  463. toggle.TextColor3 = Color3.fromRGB(15, 15, 18)
  464. toggle.Parent = frame
  465.  
  466. local toggleCorner = Instance.new("UICorner", toggle)
  467. toggleCorner.CornerRadius = UDim.new(1, 0)
  468.  
  469. -- Arrastar o frame
  470. local dragging, dragStart, startPos
  471. frame.InputBegan:Connect(function(input)
  472. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  473. dragging = true
  474. dragStart = input.Position
  475. startPos = frame.Position
  476. input.Changed:Connect(function()
  477. if input.UserInputState == Enum.UserInputState.End then
  478. dragging = false
  479. end
  480. end)
  481. end
  482. end)
  483.  
  484. frame.InputChanged:Connect(function(input)
  485. if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
  486. if dragging then
  487. local delta = input.Position - dragStart
  488. frame.Position = UDim2.new(
  489. startPos.X.Scale,
  490. startPos.X.Offset + delta.X,
  491. startPos.Y.Scale,
  492. startPos.Y.Offset + delta.Y
  493. )
  494. end
  495. end
  496. end)
  497.  
  498. -- Estado do toggle (apenas visual; a cada clique roda a ação do RightShift)
  499. local isOn = true
  500. local function setToggle(on)
  501. isOn = on
  502. if on then
  503. toggle.BackgroundColor3 = Color3.fromRGB(52, 211, 153)
  504. toggle.Text = "ON"
  505. else
  506. toggle.BackgroundColor3 = Color3.fromRGB(239, 68, 68)
  507. toggle.Text = "OFF"
  508. end
  509. end
  510.  
  511. setToggle(true)
  512.  
  513. -- Clique no botão: executa a ação do RightShift
  514. toggle.MouseButton1Click:Connect(function()
  515. OnRightShiftAction()
  516. setToggle(not isOn) -- alterna visualmente
  517. end)
  518.  
  519. -- Também ouvir a tecla RightShift real e chamar a mesma ação
  520. UIS.InputBegan:Connect(function(input, gp)
  521. if gp then return end
  522. if input.KeyCode == Enum.KeyCode.RightShift then
  523. OnRightShiftAction()
  524. end
  525. end)
Advertisement
Add Comment
Please, Sign In to add comment