Part badge script
Key RequiredUniversal

Part badge script

Universal ScriptTrollismemangomamgoTrollismemangomamgo 2.8K views 306 executesUpdated Jul 13, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•146 lines (3966 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

local espEnabled = false
local badgeParts = {}

-- Cleanup old GUI if exists
if PlayerGui:FindFirstChild("BadgeESPGUI") then
	PlayerGui.BadgeESPGUI:Destroy()
end

-- Create GUI
local gui = Instance.new("ScreenGui", PlayerGui)
gui.Name = "BadgeESPGUI"
gui.ResetOnSpawn = false

local toggle = Instance.new("TextButton", gui)
toggle.Size = UDim2.new(0, 130, 0, 40)
toggle.Position = UDim2.new(0, 10, 0, 10)
toggle.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
toggle.TextColor3 = Color3.new(1, 1, 1)
toggle.TextScaled = true
toggle.Font = Enum.Font.SourceSansBold
toggle.Text = "⚪ ESP: OFF"

-- Utility: case-insensitive search
local function stringContainsInsensitive(str, sub)
	return string.find(string.lower(str), string.lower(sub)) ~= nil
end

-- Check if part is badge-related (name or parent name contains "badge")
local function isBadgePart(part)
	if not part:IsA("BasePart") then return false end

	if stringContainsInsensitive(part.Name, "badge") then
		return true
	end

	local parent = part.Parent
	while parent and parent ~= workspace do
		if stringContainsInsensitive(parent.Name, "badge") then
			return true
		end
		parent = parent.Parent
	end

	return false
end

-- Create ESP BillboardGui on part
local function createESP(part)
	if part:FindFirstChild("BadgeESP") then return end

	local billboard = Instance.new("BillboardGui")
	billboard.Name = "BadgeESP"
	billboard.Adornee = part
	billboard.Size = UDim2.new(0, 110, 0, 50)
	billboard.StudsOffset = Vector3.new(0, part.Size.Y + 1, 0)
	billboard.AlwaysOnTop = true
	billboard.Parent = part

	local frame = Instance.new("Frame")
	frame.Size = UDim2.new(1, 0, 1, 0)
	frame.BackgroundColor3 = Color3.fromRGB(255, 255, 0)
	frame.BackgroundTransparency = 0.5
	frame.BorderSizePixel = 1
	frame.BorderColor3 = Color3.new(1, 1, 0)
	frame.Parent = billboard

	local label = Instance.new("TextLabel", billboard)
	label.Size = UDim2.new(1, 0, 0.5, 0)
	label.Position = UDim2.new(0, 0, 0, 0)
	label.BackgroundTransparency = 1
	label.Text = "🎖️ Badge"
	label.TextColor3 = Color3.fromRGB(255, 255, 0)
	label.TextScaled = true
	label.Font = Enum.Font.SourceSansBold

	local distLabel = Instance.new("TextLabel", billboard)
	distLabel.Size = UDim2.new(1, 0, 0.5, 0)
	distLabel.Position = UDim2.new(0, 0, 0.5, 0)
	distLabel.BackgroundTransparency = 1
	distLabel.Text = ""
	distLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
	distLabel.TextScaled = true
	distLabel.Font = Enum.Font.SourceSans

	-- Update distance text every frame
	local connection
	connection = RunService.RenderStepped:Connect(function()
		if not billboard.Parent or not part:IsDescendantOf(workspace) then
			connection:Disconnect()
			return
		end
		local hrp = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
		if hrp then
			local dist = (part.Position - hrp.Position).Magnitude
			distLabel.Text = math.floor(dist) .. " studs"
		else
			distLabel.Text = ""
		end
	end)
end

-- Remove all ESPs
local function clearESP()
	for _, part in ipairs(badgeParts) do
		if part and part:FindFirstChild("BadgeESP") then
			part.BadgeESP:Destroy()
		end
	end
	badgeParts = {}
end

-- Enable ESP
local function enableESP()
	clearESP()
	print("[Badge ESP] Scanning for badge parts...")
	for _, part in ipairs(workspace:GetDescendants()) do
		if part:IsA("BasePart") and isBadgePart(part) then
			createESP(part)
			table.insert(badgeParts, part)
			print("[Badge ESP] Found badge part:", part:GetFullName())
		end
	end
	print("[Badge ESP] Done.")
end

-- Disable ESP
local function disableESP()
	clearESP()
end

-- Toggle button event
toggle.MouseButton1Click:Connect(function()
	espEnabled = not espEnabled
	if espEnabled then
		toggle.Text = "🔵 ESP: ON"
		enableESP()
	else
		toggle.Text = "⚪ ESP: OFF"
		disableESP()
	end
end)

Features & Information

Part/block script badge!1!1!1!

Community Comments (2)

Only works for parts.

We lookalike

More Scripts for Universal Scripts