
Key RequiredUniversal

-- [[ 0. 版本更替与防多开系统 ]]
local SCRIPT_ID = "MyExclusiveHighlightSystem_2026"
-- 如果发现后台有正在运行的旧版本,通知它自毁
if _G[SCRIPT_ID] then
_G[SCRIPT_ID]() -- 执行旧脚本的清理回调
end
-- 创建当前版本的自毁开关
local scriptActive = true
_G[SCRIPT_ID] = function()
scriptActive = false -- 关闭循环
if _G.CleanupConnections then
for _, conn in ipairs(_G.CleanupConnections) do
if conn and conn.Connected then conn:Disconnect() end
end
end
-- 清理当前脚本产生的所有高亮
if _G.CurrentManagedParts then
for part, data in pairs(_G.CurrentManagedParts) do
if data.highlight then data.highlight:Destroy() end
end
end
print("[系统] 旧版本脚本已成功卸载并清理。")
end
---------------------------------------------------------
local player = game.Players.LocalPlayer
local myUsername = player.Name
-- [[ 核心配置参数 ]]
local R15_PER_PART = true
local R6_PER_PART = true
local UNIQUE_NAME = "ManagedHighlight"
local RESPAWN_DELAY = 0.2 -- 角色重生后的延迟应用时间(秒)
-- 获取血量颜色逻辑
local function getHealthColor(humanoid)
local healthPercent = math.clamp(humanoid.Health / humanoid.MaxHealth, 0, 1)
if humanoid.MaxHealth >= 9e9 or healthPercent >= 1 then
return Color3.fromRGB(255, 255, 255)
elseif healthPercent > 0.5 then
local t = (healthPercent - 0.5) / 0.5
return Color3.fromRGB(255, 255, 0):Lerp(Color3.fromRGB(27, 252, 107), t)
elseif healthPercent > 0 then
local t = healthPercent / 0.5
return Color3.fromRGB(255, 0, 0):Lerp(Color3.fromRGB(255, 255, 0), t)
else
return Color3.fromRGB(255, 0, 0)
end
end
-- 全局安全管理池
_G.CurrentManagedParts = _G.CurrentManagedParts or {}
local managedParts = _G.CurrentManagedParts
local checkedCache = {}
_G.CleanupConnections = {}
local function applyHighlight(target, model, isTool)
if managedParts[target] then return end
local data = {
highlight = Instance.new("Highlight"),
deathBurstHandled = false,
sourceModel = model,
feedbackTimer = isTool and 1.0 or 0
}
local h = data.highlight
h.Name = UNIQUE_NAME
h.DepthMode = Enum.HighlightDepthMode.Occluded
h.FillTransparency = 0
h.OutlineTransparency = 0
h.FillColor = Color3.fromRGB(255, 255, 255)
h.OutlineColor = Color3.fromRGB(255, 255, 255)
h.Adornee = target
h.Parent = target
managedParts[target] = data
end
-- 处理节点判定
local function processObject(obj)
if not checkedCache[obj] then
checkedCache[obj] = true
local model = (obj:IsA("Model") and obj) or (obj:IsA("BasePart") and obj:FindFirstAncestorOfClass("Model"))
if model then
local hum = model:FindFirstChildOfClass("Humanoid")
local isMatch = model.Name:find(myUsername) or (hum and (hum.DisplayName:find(myUsername) or hum.Name:find(myUsername)))
if isMatch then
local usePerPart = hum and ((hum.RigType == Enum.HumanoidRigType.R15 and R15_PER_PART) or (hum.RigType == Enum.HumanoidRigType.R6 and R6_PER_PART))
if usePerPart then
if obj:IsA("BasePart") then applyHighlight(obj, model, obj:FindFirstAncestorOfClass("Tool") ~= nil) end
else
if obj == model then applyHighlight(model, model, false) end
end
end
end
end
end
-- 拦截与添加逻辑
local function handleNewDescendant(obj)
-- 【动态强杀】:如果是别的高亮,在生成的这一帧直接抹除
if obj:IsA("Highlight") and obj.Name ~= UNIQUE_NAME then
task.defer(function()
if obj and obj.Parent then obj:Destroy() end
end)
return
end
processObject(obj)
end
-- 刷新与扫描角色函数
local function refreshCharacter(char)
if not char then return end
-- 等待指定时间,确保 R6/R15 肢体及服装材质完全加载绑定完成
task.wait(RESPAWN_DELAY)
if not scriptActive then return end
-- 清理旧缓存(防止重名前后对象指针混淆)
for part, data in pairs(managedParts) do
if not part:IsDescendantOf(game.Workspace) then
if data.highlight then data.highlight:Destroy() end
managedParts[part] = nil
checkedCache[part] = nil
end
end
-- 深度重新扫描新角色的所有部位
for _, v in ipairs(char:GetDescendants()) do
checkedCache[v] = nil -- 强制重置缓存
processObject(v)
end
end
-- 监听角色重生事件
local charConnection = player.CharacterAdded:Connect(function(newChar)
refreshCharacter(newChar)
end)
table.insert(_G.CleanupConnections, charConnection)
-- 绑定 Workspace 动态监听
local descendantConnection = game.Workspace.DescendantAdded:Connect(handleNewDescendant)
table.insert(_G.CleanupConnections, descendantConnection)
-- 初始加载执行
if player.Character then
task.spawn(refreshCharacter, player.Character)
end
for _, v in ipairs(game.Workspace:GetDescendants()) do
task.spawn(handleNewDescendant, v)
end
-- 核心渲染控制循环(带自毁检测)
task.spawn(function()
local t_rainbow = 0
local t_death = 0
while scriptActive do
for part, data in pairs(managedParts) do
if not part:IsDescendantOf(game.Workspace) then
if data.highlight then data.highlight:Destroy() end
managedParts[part] = nil
checkedCache[part] = nil
else
local h = data.highlight
local hum = data.sourceModel:FindFirstChildOfClass("Humanoid")
local isDead = hum and hum.Health <= 0
local inWhiteMode = data.sourceModel:FindFirstChildOfClass("ForceField") or (hum and hum.MaxHealth >= 9e9)
if data.feedbackTimer > 0 then data.feedbackTimer = math.max(0, data.feedbackTimer - 0.05) end
if isDead then
if not data.deathBurstHandled then
h.FillColor = Color3.fromRGB(255, 255, 255)
h.OutlineColor = Color3.fromRGB(255, 255, 255)
data.deathBurstHandled = true
end
t_death = t_death + 0.35
local targetOutline = Color3.fromRGB(255, 0, 0):Lerp(Color3.fromRGB(255, 0, 150), (math.sin(t_death) + 1) / 2)
h.OutlineColor = h.OutlineColor:Lerp(targetOutline, 0.15)
h.FillColor = h.FillColor:Lerp(Color3.fromRGB(120, 0, 10):Lerp(targetOutline, 0.1), 0.03)
elseif inWhiteMode then
local r, g, b = math.sin(t_rainbow)*127+128, math.sin(t_rainbow+2)*127+128, math.sin(t_rainbow+4)*127+128
h.FillColor = h.FillColor:Lerp(Color3.fromRGB(255, 255, 255), 0.2)
h.OutlineColor = h.OutlineColor:Lerp(Color3.fromRGB(r, g, b):Lerp(Color3.fromRGB(255, 255, 255), data.feedbackTimer), 0.2)
data.deathBurstHandled = false
else
local hColor = hum and getHealthColor(hum) or Color3.fromRGB(255, 255, 255)
h.FillColor = h.FillColor:Lerp(Color3.fromRGB(0, 0, 0):Lerp(Color3.fromRGB(255, 255, 255), data.feedbackTimer), 0.04)
h.OutlineColor = h.OutlineColor:Lerp(hColor:Lerp(Color3.fromRGB(255, 255, 255), data.feedbackTimer), 0.12)
data.deathBurstHandled = false
end
end
end
t_rainbow = t_rainbow + 0.1
task.wait(0.02)
end
end)



👍🏻🙂?
Cool
made an account to say W script, can u make more like these and auras as well ?
Is it fe?
@Kinitopet890bloxHack no
@NPC_PlayersNoob_Alt oh ok but btw it's cool thanks
@Kinitopet890bloxHack yes