Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- KRNL Mobile Combat Script
- -- Compatível com executores mobile
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local Workspace = game:GetService("Workspace")
- local Camera = Workspace.CurrentCamera
- local TweenService = game:GetService("TweenService")
- local LocalPlayer = Players.LocalPlayer
- local Mouse = LocalPlayer:GetMouse()
- -- Variáveis principais
- local GUI = nil
- local MainFrame = nil
- local LoadingFrame = nil
- local aimbotEnabled = false
- local currentTarget = nil
- local fovCircle = nil
- local connection = nil
- local guiVisible = false
- -- Configurações
- local config = {
- fovSize = 150,
- aimSpeed = 0.2,
- wallCheck = true,
- rainbowSpeed = 2
- }
- -- Função para criar efeito rainbow
- local function getRainbowColor(offset)
- local time = tick() * config.rainbowSpeed + (offset or 0)
- return Color3.fromHSV(time % 1, 1, 1)
- end
- -- Função para verificar se o jogador está visível (sem paredes)
- local function isPlayerVisible(player)
- if not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then
- return false
- end
- if not config.wallCheck then
- return true
- end
- local character = player.Character
- local humanoidRootPart = character.HumanoidRootPart
- local head = character:FindFirstChild("Head")
- if not head then
- return false
- end
- local rayOrigin = Camera.CFrame.Position
- local rayDirection = (head.Position - rayOrigin).Unit * (head.Position - rayOrigin).Magnitude
- local raycastParams = RaycastParams.new()
- raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
- raycastParams.FilterDescendantsInstances = {LocalPlayer.Character, character}
- local raycastResult = Workspace:Raycast(rayOrigin, rayDirection, raycastParams)
- return raycastResult == nil
- end
- -- Função para obter o jogador mais próximo no FOV
- local function getClosestPlayerInFOV()
- local closestPlayer = nil
- local shortestDistance = math.huge
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
- local character = player.Character
- local humanoidRootPart = character.HumanoidRootPart
- local head = character:FindFirstChild("Head")
- if head then
- local screenPosition, onScreen = Camera:WorldToScreenPoint(head.Position)
- if onScreen then
- local mousePosition = Vector2.new(Mouse.X, Mouse.Y)
- local targetPosition = Vector2.new(screenPosition.X, screenPosition.Y)
- local distance = (mousePosition - targetPosition).Magnitude
- if distance <= config.fovSize and distance < shortestDistance then
- if isPlayerVisible(player) then
- closestPlayer = player
- shortestDistance = distance
- end
- end
- end
- end
- end
- end
- return closestPlayer
- end
- -- Função para criar o círculo FOV
- local function createFOVCircle()
- if fovCircle then
- fovCircle:Remove()
- end
- fovCircle = Drawing.new("Circle")
- fovCircle.Transparency = 0.7
- fovCircle.Thickness = 2
- fovCircle.Filled = false
- fovCircle.Radius = config.fovSize
- fovCircle.Visible = false
- end
- -- Função para atualizar FOV
- local function updateFOV()
- if fovCircle and aimbotEnabled then
- fovCircle.Position = Vector2.new(Mouse.X, Mouse.Y)
- fovCircle.Color = getRainbowColor()
- fovCircle.Visible = true
- elseif fovCircle then
- fovCircle.Visible = false
- end
- end
- -- Função principal do aimbot
- local function aimbot()
- if not aimbotEnabled then
- currentTarget = nil
- return
- end
- local target = getClosestPlayerInFOV()
- if target and target.Character and target.Character:FindFirstChild("Head") then
- currentTarget = target
- local head = target.Character.Head
- local targetPosition = head.Position
- -- Suavizar o movimento da câmera
- local currentCFrame = Camera.CFrame
- local targetCFrame = CFrame.lookAt(currentCFrame.Position, targetPosition)
- local tweenInfo = TweenInfo.new(config.aimSpeed, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
- local tween = TweenService:Create(Camera, tweenInfo, {CFrame = targetCFrame})
- tween:Play()
- else
- currentTarget = nil
- end
- end
- -- Função para criar a tela de loading
- local function createLoadingScreen()
- LoadingFrame = Instance.new("Frame")
- LoadingFrame.Size = UDim2.new(1, 0, 1, 0)
- LoadingFrame.Position = UDim2.new(0, 0, 0, 0)
- LoadingFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 25)
- LoadingFrame.BorderSizePixel = 0
- LoadingFrame.Parent = GUI
- -- Título
- local titleLabel = Instance.new("TextLabel")
- titleLabel.Size = UDim2.new(0, 300, 0, 50)
- titleLabel.Position = UDim2.new(0.5, -150, 0.3, 0)
- titleLabel.BackgroundTransparency = 1
- titleLabel.Text = "COMBAT SCRIPT"
- titleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- titleLabel.TextSize = 28
- titleLabel.Font = Enum.Font.GothamBold
- titleLabel.Parent = LoadingFrame
- -- Barra de progresso fundo
- local progressBG = Instance.new("Frame")
- progressBG.Size = UDim2.new(0, 300, 0, 8)
- progressBG.Position = UDim2.new(0.5, -150, 0.5, 0)
- progressBG.BackgroundColor3 = Color3.fromRGB(40, 40, 45)
- progressBG.BorderSizePixel = 0
- progressBG.Parent = LoadingFrame
- -- Barra de progresso
- local progressBar = Instance.new("Frame")
- progressBar.Size = UDim2.new(0, 0, 1, 0)
- progressBar.Position = UDim2.new(0, 0, 0, 0)
- progressBar.BackgroundColor3 = Color3.fromRGB(0, 255, 127)
- progressBar.BorderSizePixel = 0
- progressBar.Parent = progressBG
- -- Adicionar cantos arredondados
- local corner1 = Instance.new("UICorner")
- corner1.CornerRadius = UDim.new(0, 4)
- corner1.Parent = progressBG
- local corner2 = Instance.new("UICorner")
- corner2.CornerRadius = UDim.new(0, 4)
- corner2.Parent = progressBar
- -- Animação da barra de progresso
- local tweenInfo = TweenInfo.new(3, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
- local tween = TweenService:Create(progressBar, tweenInfo, {Size = UDim2.new(1, 0, 1, 0)})
- tween:Play()
- tween.Completed:Connect(function()
- wait(0.5)
- LoadingFrame:TweenSize(UDim2.new(1, 0, 0, 0), "Out", "Sine", 0.5, true)
- wait(0.5)
- LoadingFrame:Destroy()
- createMainInterface()
- end)
- end
- -- Função para criar a interface principal
- local function createMainInterface()
- -- Frame principal
- MainFrame = Instance.new("Frame")
- MainFrame.Size = UDim2.new(0, 400, 0, 300)
- MainFrame.Position = UDim2.new(0.5, -200, 0.5, -150)
- MainFrame.BackgroundColor3 = Color3.fromRGB(25, 25, 30)
- MainFrame.BorderSizePixel = 0
- MainFrame.Active = true
- MainFrame.Draggable = true
- MainFrame.Parent = GUI
- -- Cantos arredondados
- local corner = Instance.new("UICorner")
- corner.CornerRadius = UDim.new(0, 12)
- corner.Parent = MainFrame
- -- Header
- local header = Instance.new("Frame")
- header.Size = UDim2.new(1, 0, 0, 40)
- header.Position = UDim2.new(0, 0, 0, 0)
- header.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
- header.BorderSizePixel = 0
- header.Parent = MainFrame
- local headerCorner = Instance.new("UICorner")
- headerCorner.CornerRadius = UDim.new(0, 12)
- headerCorner.Parent = header
- -- Título do header
- local headerTitle = Instance.new("TextLabel")
- headerTitle.Size = UDim2.new(1, -20, 1, 0)
- headerTitle.Position = UDim2.new(0, 20, 0, 0)
- headerTitle.BackgroundTransparency = 1
- headerTitle.Text = "Combat Script v1.0"
- headerTitle.TextColor3 = Color3.fromRGB(255, 255, 255)
- headerTitle.TextSize = 16
- headerTitle.Font = Enum.Font.GothamBold
- headerTitle.TextXAlignment = Enum.TextXAlignment.Left
- headerTitle.Parent = header
- -- Botão de fechar
- local closeButton = Instance.new("TextButton")
- closeButton.Size = UDim2.new(0, 30, 0, 30)
- closeButton.Position = UDim2.new(1, -35, 0, 5)
- closeButton.BackgroundColor3 = Color3.fromRGB(255, 50, 50)
- closeButton.BorderSizePixel = 0
- closeButton.Text = "×"
- closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- closeButton.TextSize = 18
- closeButton.Font = Enum.Font.GothamBold
- closeButton.Parent = header
- local closeCorner = Instance.new("UICorner")
- closeCorner.CornerRadius = UDim.new(0, 15)
- closeCorner.Parent = closeButton
- -- Tab Combat
- local combatTab = Instance.new("Frame")
- combatTab.Size = UDim2.new(1, -20, 1, -60)
- combatTab.Position = UDim2.new(0, 10, 0, 50)
- combatTab.BackgroundTransparency = 1
- combatTab.Parent = MainFrame
- -- Toggle do Aimbot
- local aimbotToggle = Instance.new("Frame")
- aimbotToggle.Size = UDim2.new(1, 0, 0, 50)
- aimbotToggle.Position = UDim2.new(0, 0, 0, 20)
- aimbotToggle.BackgroundColor3 = Color3.fromRGB(35, 35, 40)
- aimbotToggle.BorderSizePixel = 0
- aimbotToggle.Parent = combatTab
- local toggleCorner = Instance.new("UICorner")
- toggleCorner.CornerRadius = UDim.new(0, 8)
- toggleCorner.Parent = aimbotToggle
- local toggleLabel = Instance.new("TextLabel")
- toggleLabel.Size = UDim2.new(1, -60, 1, 0)
- toggleLabel.Position = UDim2.new(0, 15, 0, 0)
- toggleLabel.BackgroundTransparency = 1
- toggleLabel.Text = "Aimbot com FOV Rainbow"
- toggleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- toggleLabel.TextSize = 14
- toggleLabel.Font = Enum.Font.Gotham
- toggleLabel.TextXAlignment = Enum.TextXAlignment.Left
- toggleLabel.Parent = aimbotToggle
- local toggleButton = Instance.new("TextButton")
- toggleButton.Size = UDim2.new(0, 45, 0, 25)
- toggleButton.Position = UDim2.new(1, -55, 0.5, -12.5)
- toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 65)
- toggleButton.BorderSizePixel = 0
- toggleButton.Text = ""
- toggleButton.Parent = aimbotToggle
- local buttonCorner = Instance.new("UICorner")
- buttonCorner.CornerRadius = UDim.new(0, 12.5)
- buttonCorner.Parent = toggleButton
- local toggleIndicator = Instance.new("Frame")
- toggleIndicator.Size = UDim2.new(0, 21, 0, 21)
- toggleIndicator.Position = UDim2.new(0, 2, 0, 2)
- toggleIndicator.BackgroundColor3 = Color3.fromRGB(200, 200, 200)
- toggleIndicator.BorderSizePixel = 0
- toggleIndicator.Parent = toggleButton
- local indicatorCorner = Instance.new("UICorner")
- indicatorCorner.CornerRadius = UDim.new(0, 10.5)
- indicatorCorner.Parent = toggleIndicator
- -- Função do toggle
- local function toggleAimbot()
- aimbotEnabled = not aimbotEnabled
- if aimbotEnabled then
- toggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 127)
- toggleIndicator:TweenPosition(UDim2.new(1, -23, 0, 2), "Out", "Sine", 0.2, true)
- else
- toggleButton.BackgroundColor3 = Color3.fromRGB(60, 60, 65)
- toggleIndicator:TweenPosition(UDim2.new(0, 2, 0, 2), "Out", "Sine", 0.2, true)
- end
- end
- toggleButton.MouseButton1Click:Connect(toggleAimbot)
- closeButton.MouseButton1Click:Connect(function()
- guiVisible = false
- MainFrame:TweenSize(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, true)
- wait(0.3)
- GUI.Enabled = false
- end)
- end
- -- Função para criar a GUI principal
- local function createGUI()
- GUI = Instance.new("ScreenGui")
- GUI.Name = "CombatScript"
- GUI.Parent = game.CoreGui
- GUI.ResetOnSpawn = false
- createLoadingScreen()
- createFOVCircle()
- end
- -- Função para toggle da interface
- local function toggleGUI()
- if not GUI then
- createGUI()
- guiVisible = true
- return
- end
- if guiVisible then
- guiVisible = false
- if MainFrame then
- MainFrame:TweenSize(UDim2.new(0, 0, 0, 0), "In", "Back", 0.3, true)
- wait(0.3)
- end
- GUI.Enabled = false
- else
- guiVisible = true
- GUI.Enabled = true
- if MainFrame then
- MainFrame.Size = UDim2.new(0, 0, 0, 0)
- MainFrame:TweenSize(UDim2.new(0, 400, 0, 300), "Out", "Back", 0.3, true)
- end
- end
- end
- -- Conexões principais
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if gameProcessed then return end
- -- Toggle GUI com Insert ou RightShift (para mobile use touch)
- if input.KeyCode == Enum.KeyCode.Insert or input.KeyCode == Enum.KeyCode.RightShift then
- toggleGUI()
- end
- end)
- -- Loop principal
- connection = RunService.Heartbeat:Connect(function()
- updateFOV()
- aimbot()
- end)
- -- Inicialização
- createGUI()
- print("Combat Script carregado com sucesso!")
- print("Pressione INSERT ou RightShift para abrir/fechar a interface")
- print("Funcionalidades:")
- print("- FOV Rainbow com detecção de jogadores")
- print("- Aimbot suave com verificação de visibilidade")
- print("- Interface moderna e responsiva")
- print("- Compatível com KRNL Mobil")
- -- Botão Toggle flutuante que chama a mesma ação do RightShift
- -- Coloque este script como LocalScript (p.ex. StarterPlayerScripts)
- local Players = game:GetService("Players")
- local UIS = game:GetService("UserInputService")
- local player = Players.LocalPlayer
- -- === FUNÇÃO QUE REPRESENTA "APERTAR RIGHTSHIFT" ===
- local function OnRightShiftAction()
- -- TODO: Coloque aqui o que você quer que aconteça quando "apertar RightShift"
- -- Exemplo: alternar visibilidade de uma UI
- print("Ação do RightShift executada!")
- end
- -- === GUI ===
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "ToggleRightShiftGUI"
- screenGui.ResetOnSpawn = false
- screenGui.IgnoreGuiInset = true
- screenGui.Parent = player:WaitForChild("PlayerGui")
- local frame = Instance.new("Frame")
- frame.Size = UDim2.fromOffset(180, 56)
- frame.Position = UDim2.new(0, 30, 0.2, 0)
- frame.BackgroundColor3 = Color3.fromRGB(24, 24, 28)
- frame.BorderSizePixel = 0
- frame.Active = true -- necessário para arrastar
- frame.Parent = screenGui
- -- cantos arredondados + borda sutil
- local corner = Instance.new("UICorner", frame)
- corner.CornerRadius = UDim.new(0, 14)
- local stroke = Instance.new("UIStroke", frame)
- stroke.Thickness = 1
- stroke.Transparency = 0.3
- local title = Instance.new("TextLabel")
- title.Size = UDim2.new(1, -70, 1, 0)
- title.Position = UDim2.fromOffset(12, 0)
- title.BackgroundTransparency = 1
- title.Text = "RightShift"
- title.Font = Enum.Font.GothamSemibold
- title.TextScaled = true
- title.TextColor3 = Color3.fromRGB(235, 235, 240)
- title.TextXAlignment = Enum.TextXAlignment.Left
- title.Parent = frame
- local toggle = Instance.new("TextButton")
- toggle.Size = UDim2.fromOffset(64, 36)
- toggle.Position = UDim2.new(1, -12 - 64, 0.5, -18)
- toggle.BackgroundColor3 = Color3.fromRGB(52, 211, 153) -- verde (ON) inicial
- toggle.AutoButtonColor = true
- toggle.Text = "ON"
- toggle.Font = Enum.Font.GothamBold
- toggle.TextScaled = true
- toggle.TextColor3 = Color3.fromRGB(15, 15, 18)
- toggle.Parent = frame
- local toggleCorner = Instance.new("UICorner", toggle)
- toggleCorner.CornerRadius = UDim.new(1, 0)
- -- Arrastar o frame
- local dragging, 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
- if 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
- end)
- -- Estado do toggle (apenas visual; a cada clique roda a ação do RightShift)
- local isOn = true
- local function setToggle(on)
- isOn = on
- if on then
- toggle.BackgroundColor3 = Color3.fromRGB(52, 211, 153)
- toggle.Text = "ON"
- else
- toggle.BackgroundColor3 = Color3.fromRGB(239, 68, 68)
- toggle.Text = "OFF"
- end
- end
- setToggle(true)
- -- Clique no botão: executa a ação do RightShift
- toggle.MouseButton1Click:Connect(function()
- OnRightShiftAction()
- setToggle(not isOn) -- alterna visualmente
- end)
- -- Também ouvir a tecla RightShift real e chamar a mesma ação
- UIS.InputBegan:Connect(function(input, gp)
- if gp then return end
- if input.KeyCode == Enum.KeyCode.RightShift then
- OnRightShiftAction()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment