ESP, AIMBOT and XRAY
Key RequiredUniversal

ESP, AIMBOT and XRAY

Universal Scriptsquhzsquhz 17.5K views 211 executesUpdated Apr 25, 2025
5.0/ 5(6 votes)
60100% Positive
Lua Script•156 lines (4511 chars)
-- All the needed GUI elements
local library = loadstring(game:HttpGet("https://raw.githubusercontent.com/Turtle-Brand/Turtle-Lib/main/source.lua"))()
local window = library:Window("Highlight Users")

-- All the needed variables
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local localPlayer = Players.LocalPlayer
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")

-- The CoHub text.. OFC
window:Label("Made from the CoHub team")

-- ESP Logic
local espEnabled = false

local function applyESP(player)
	if player == localPlayer then return end
	if not player.Character then return end
	if player.Character:FindFirstChild("ESP_Highlight") then return end

	local highlight = Instance.new("Highlight")
	highlight.Name = "ESP_Highlight"
	highlight.Adornee = player.Character
	highlight.FillColor = Color3.fromRGB(255, 0, 0)
	highlight.OutlineColor = Color3.fromRGB(255, 255, 255)
	highlight.FillTransparency = 0.5
	highlight.OutlineTransparency = 0
	highlight.Parent = player.Character
end

local function removeESP(player)
	if player.Character then
		local highlight = player.Character:FindFirstChild("ESP_Highlight")
		if highlight then highlight:Destroy() end
	end
end

local function updateESPState()
	for _, player in ipairs(Players:GetPlayers()) do
		if player ~= localPlayer then
			if espEnabled then
				applyESP(player)
			else
				removeESP(player)
			end
		end
	end
end

Players.PlayerAdded:Connect(function(player)
	if player == localPlayer then return end
	player.CharacterAdded:Connect(function()
		repeat task.wait() until player.Character and player.Character:FindFirstChild("HumanoidRootPart")
		if espEnabled then
			applyESP(player)
		end
	end)
end)

for _, player in ipairs(Players:GetPlayers()) do
	if player ~= localPlayer then
		player.CharacterAdded:Connect(function()
			repeat task.wait() until player.Character and player.Character:FindFirstChild("HumanoidRootPart")
			if espEnabled then
				applyESP(player)
			end
		end)
		if player.Character and espEnabled then
			applyESP(player)
		end
	end
end

-- ESP Toggle
window:Toggle("ESP Toggle", false, function(bool)
	espEnabled = bool
	updateESPState()
end)

-- XRAY Logic
local xrayEnabled = false
local originalTransparency = {}

local function toggleXray(enable)
	xrayEnabled = enable
	for _, obj in ipairs(workspace:GetDescendants()) do
		if obj:IsA("BasePart") and not obj:IsDescendantOf(Players) then
			if enable then
				if not originalTransparency[obj] then
					originalTransparency[obj] = obj.Transparency
				end
				obj.Transparency = 0.6
			else
				if originalTransparency[obj] ~= nil then
					obj.Transparency = originalTransparency[obj]
				end
			end
		end
	end
	if not enable then
		originalTransparency = {} -- Clear memory
	end
end

window:Label("Use 'Q' to turn on head-aimbot")

-- XRAY Toggle
window:Toggle("Xray", false, function(bool)
	toggleXray(bool)
end)

window:Button("Close GUI", function() -- Close the GUI button
    window:Destroy() -- Destroy the GUI window so it wont come back after respawn
end)

local enabled = false

UserInputService.InputBegan:Connect(function(input, gameProcessed)
    if gameProcessed then return end
    if input.KeyCode == Enum.KeyCode.Q then
        enabled = not enabled
    end
end)

function getClosestPlayer()
    local closest, minDist = nil, math.huge
    for _, player in ipairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Head") then
            local head = player.Character.Head.Position
            local screenPos, onScreen = Camera:WorldToViewportPoint(head)
            if onScreen then
                local dist = (Vector2.new(screenPos.X, screenPos.Y) - Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)).Magnitude
                if dist < minDist then
                    minDist = dist
                    closest = player
                end
            end
        end
    end
    return closest
end

RunService.RenderStepped:Connect(function()
    if not enabled then return end

    local target = getClosestPlayer()
    if target and target.Character and target.Character:FindFirstChild("Head") then
        local head = target.Character.Head.Position
        Camera.CFrame = CFrame.new(Camera.CFrame.Position, head)
    end
end)

Features & Information

The aimbot is for PC players or players with a keyboard only.. The rest of the GUI should work for all, thanks!!
#Aimbot#Xray#Esp#Easy#OpenSource

Community Comments (1)

squhzsquhzApr 25, 2025

Please join the server to report bugs or suggest new scripts

More Scripts for Universal Scripts