0% found this document useful (0 votes)
6 views3 pages

Message

Uploaded by

lungs58092
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Message

Uploaded by

lungs58092
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

-- Place this script in StarterGui for UI and LocalScript for aimbot

local Players = game:GetService("Players")


local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera
local AimbotKey = Enum.KeyCode.E -- Default aimbot toggle key
local ChangeKeybindKey = Enum.KeyCode.Z -- Default key to change aimbot keybind
local AimbotEnabled = false
local ChangingKeybind = false

-- Create UI
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

local Frame = Instance.new("Frame")


Frame.Size = UDim2.new(0, 200, 0, 150)
Frame.Position = UDim2.new(0.5, -100, 0.1, 0)
Frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
Frame.Parent = ScreenGui

local HighlightButton = Instance.new("TextButton")


HighlightButton.Size = UDim2.new(1, 0, 0.33, 0)
HighlightButton.Text = "Toggle Highlight"
HighlightButton.Parent = Frame

local AimbotButton = Instance.new("TextButton")


AimbotButton.Size = UDim2.new(1, 0, 0.33, 0)
AimbotButton.Position = UDim2.new(0, 0, 0.33, 0)
AimbotButton.Text = "Toggle Aimbot"
AimbotButton.Parent = Frame

local ChangeKeybindButton = Instance.new("TextButton")


ChangeKeybindButton.Size = UDim2.new(1, 0, 0.33, 0)
ChangeKeybindButton.Position = UDim2.new(0, 0, 0.66, 0)
ChangeKeybindButton.Text = "Change Aimbot Keybind"
ChangeKeybindButton.Parent = Frame

-- Function to create a highlight effect


local function highlightPlayer(player)
if player.Character then
local highlight = Instance.new("Highlight")
highlight.Parent = player.Character
highlight.FillColor = Color3.fromRGB(255, 255, 0)
highlight.OutlineColor = Color3.fromRGB(255, 0, 0)
highlight.FillTransparency = 0.5
highlight.OutlineTransparency = 0
end
end

-- Highlight existing players


for _, player in pairs(Players:GetPlayers()) do
player.CharacterAdded:Connect(function()
highlightPlayer(player)
end)
if player.Character then
highlightPlayer(player)
end
end
-- Listen for new players joining
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
highlightPlayer(player)
end)
end)

-- Aimbot function
local function getClosestEnemy()
local closestEnemy = nil
local shortestDistance = math.huge
for _, player in pairs(Players:GetPlayers()) do
if player ~= LocalPlayer and player.Team ~= LocalPlayer.Team and
player.Character and player.Character:FindFirstChild("Head") then
local headPosition = player.Character.Head.Position
local screenPoint, onScreen = Camera:WorldToViewportPoint(headPosition)
if onScreen then
local mousePos = UserInputService:GetMouseLocation()
local distance = (Vector2.new(screenPoint.X, screenPoint.Y) -
mousePos).Magnitude
if distance < shortestDistance then
shortestDistance = distance
closestEnemy = player
end
end
end
end
return closestEnemy
end

-- Aimbot loop
RunService.RenderStepped:Connect(function()
if AimbotEnabled then
local target = getClosestEnemy()
if target and target.Character and target.Character:FindFirstChild("Head")
then
Camera.CFrame = CFrame.new(Camera.CFrame.Position,
target.Character.Head.Position)
end
end
end)

-- Toggle functions
HighlightButton.MouseButton1Click:Connect(function()
for _, player in pairs(Players:GetPlayers()) do
highlightPlayer(player)
end
end)

AimbotButton.MouseButton1Click:Connect(function()
AimbotEnabled = not AimbotEnabled
AimbotButton.Text = AimbotEnabled and "Aimbot: ON" or "Aimbot: OFF"
end)

ChangeKeybindButton.MouseButton1Click:Connect(function()
ChangeKeybindButton.Text = "Press a Key..."
ChangingKeybind = true
end)
-- Handle keybind changing and toggling aimbot
UserInputService.InputBegan:Connect(function(input, processed)
if not processed then
if ChangingKeybind then
AimbotKey = input.KeyCode
ChangeKeybindButton.Text = "Change Aimbot Keybind"
ChangingKeybind = false
elseif input.KeyCode == AimbotKey then
AimbotEnabled = not AimbotEnabled
AimbotButton.Text = AimbotEnabled and "Aimbot: ON" or "Aimbot: OFF"
end
end
end)

You might also like