Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local StarterGui = game:GetService("StarterGui")
- -- Create Password GUI
- local ScreenGui = Instance.new("ScreenGui")
- ScreenGui.Name = "KeySystem"
- ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local MainFrame = Instance.new("Frame")
- MainFrame.Name = "MainFrame"
- MainFrame.Size = UDim2.new(0, 300, 0, 200)
- MainFrame.Position = UDim2.new(0.5, -150, 0.5, -100)
- MainFrame.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
- MainFrame.Parent = ScreenGui
- local TitleLabel = Instance.new("TextLabel")
- TitleLabel.Size = UDim2.new(1, 0, 0, 50)
- TitleLabel.Position = UDim2.new(0, 0, 0, 0)
- TitleLabel.BackgroundTransparency = 1
- TitleLabel.Text = "KEY"
- TitleLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- TitleLabel.TextSize = 30
- TitleLabel.Font = Enum.Font.GothamBold
- TitleLabel.Parent = MainFrame
- local KeyBox = Instance.new("TextBox")
- KeyBox.Size = UDim2.new(0.8, 0, 0, 40)
- KeyBox.Position = UDim2.new(0.1, 0, 0.4, 0)
- KeyBox.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
- KeyBox.TextColor3 = Color3.fromRGB(255, 255, 255)
- KeyBox.PlaceholderText = "Enter Key Here..."
- KeyBox.TextSize = 20
- KeyBox.Parent = MainFrame
- local SubmitButton = Instance.new("TextButton")
- SubmitButton.Size = UDim2.new(0.8, 0, 0, 40)
- SubmitButton.Position = UDim2.new(0.1, 0, 0.7, 0)
- SubmitButton.BackgroundColor3 = Color3.fromRGB(0, 120, 255)
- SubmitButton.TextColor3 = Color3.fromRGB(255, 255, 255)
- SubmitButton.Text = "Submit"
- SubmitButton.TextSize = 20
- SubmitButton.Parent = MainFrame
- -- Variables
- local aimbotEnabled = false
- local espEnabled = false
- local currentTarget = nil
- local scriptUnlocked = false
- -- Status GUI (Initially hidden)
- local StatusGui = Instance.new("ScreenGui")
- StatusGui.Name = "AimbotStatus"
- StatusGui.Enabled = false
- StatusGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
- local StatusLabel = Instance.new("TextLabel")
- StatusLabel.Size = UDim2.new(0, 200, 0, 50)
- StatusLabel.Position = UDim2.new(1, -220, 0, 20)
- StatusLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- StatusLabel.BackgroundTransparency = 0.5
- StatusLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
- StatusLabel.Text = "Aimbot: OFF"
- StatusLabel.TextSize = 20
- StatusLabel.Parent = StatusGui
- -- ESP Functions
- local function createESP()
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer and player.Character then
- if not player.Character:FindFirstChild("Highlight") then
- local highlight = Instance.new("Highlight")
- highlight.FillColor = Color3.fromRGB(0, 255, 0)
- highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
- highlight.Parent = player.Character
- end
- end
- end
- end
- local function removeESP()
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer and player.Character then
- local highlight = player.Character:FindFirstChild("Highlight")
- if highlight then
- highlight:Destroy()
- end
- end
- end
- end
- -- Key System
- SubmitButton.MouseButton1Click:Connect(function()
- if KeyBox.Text == "subscribe" then
- scriptUnlocked = true
- ScreenGui:Destroy()
- StatusGui.Enabled = true
- StarterGui:SetCore("SendNotification", {
- Title = "Success!",
- Text = "Aimbot Unlocked - Press E to toggle, B for ESP",
- Duration = 3
- })
- else
- StarterGui:SetCore("SendNotification", {
- Title = "Error",
- Text = "Invalid Key!",
- Duration = 2
- })
- KeyBox.Text = ""
- end
- end)
- -- Aimbot Functions
- local function getClosestPlayer()
- if currentTarget and currentTarget.Character and
- currentTarget.Character:FindFirstChild("Humanoid") and
- currentTarget.Character.Humanoid.Health > 0 then
- return currentTarget
- end
- local closest = nil
- local maxDistance = 1000
- local shortestDistance = maxDistance
- for _, player in pairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer and
- player.Character and
- player.Character:FindFirstChild("Humanoid") and
- player.Character.Humanoid.Health > 0 then
- local distance = (player.Character.HumanoidRootPart.Position - Players.LocalPlayer.Character.HumanoidRootPart.Position).Magnitude
- if distance < shortestDistance then
- closest = player
- shortestDistance = distance
- end
- end
- end
- currentTarget = closest
- return closest
- end
- -- Input Handler
- UserInputService.InputBegan:Connect(function(input, gameProcessed)
- if not scriptUnlocked then return end
- if gameProcessed then return end
- if input.KeyCode == Enum.KeyCode.E then
- aimbotEnabled = not aimbotEnabled
- StatusLabel.Text = "Aimbot: " .. (aimbotEnabled and "ON" or "OFF")
- StatusLabel.BackgroundColor3 = aimbotEnabled and Color3.fromRGB(0, 255, 0) or Color3.fromRGB(255, 0, 0)
- StarterGui:SetCore("SendNotification", {
- Title = "Aimbot",
- Text = aimbotEnabled and "Enabled" or "Disabled",
- Duration = 2
- })
- elseif input.KeyCode == Enum.KeyCode.B then
- espEnabled = not espEnabled
- if espEnabled then
- createESP()
- else
- removeESP()
- end
- StarterGui:SetCore("SendNotification", {
- Title = "ESP",
- Text = espEnabled and "ESP Enabled" or "ESP Disabled",
- Duration = 2
- })
- end
- end)
- -- ESP for new players
- Players.PlayerAdded:Connect(function(player)
- if espEnabled then
- player.CharacterAdded:Connect(function(character)
- if espEnabled then
- local highlight = Instance.new("Highlight")
- highlight.FillColor = Color3.fromRGB(0, 255, 0)
- highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
- highlight.Parent = character
- end
- end)
- end
- end)
- -- Main Loop
- RunService.RenderStepped:Connect(function()
- if scriptUnlocked and aimbotEnabled then
- local target = getClosestPlayer()
- if target and target.Character and target.Character:FindFirstChild("Head") then
- workspace.CurrentCamera.CFrame = CFrame.new(workspace.CurrentCamera.CFrame.Position, target.Character.Head.Position)
- end
- end
- end)
- -- Initial Notification
- StarterGui:SetCore("SendNotification", {
- Title = "Key System",
- Text = "Enter password: subscribe",
- Duration = 5
- })
Add Comment
Please, Sign In to add comment