UAV or Drone Script
Key RequiredUniversal

UAV or Drone Script

Universal ScriptRSCRIPTS_FALSEBAN_MERSCRIPTS_FALSEBAN_ME 1.1K views 1.3K executesUpdated Feb 21, 2026
Unrated
00
Lua Script•288 lines (8091 chars)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local CollectionService = game:GetService("CollectionService")
local player = Players.LocalPlayer
local backpack = player:WaitForChild("Backpack")

local Cache = { 
    TrackedNPCs = {} 
}
local npcHighlights = {}

local function applyToNPC(model)
    if not model or not model.Parent then return end
    
    task.wait(0.1)
    
    local root = model:FindFirstChild("HumanoidRootPart")
               or model.PrimaryPart
               or model:FindFirstChildWhichIsA("BasePart", true)
    
    if not root then return end
    
    local hl = Instance.new("Highlight")
    hl.Name = "NPC_UAVHighlight"
    hl.Adornee = model
    hl.FillColor = Color3.fromRGB(255, 150, 0)
    hl.OutlineColor = Color3.fromRGB(255, 255, 100)
    hl.FillTransparency = 0.65
    hl.OutlineTransparency = 0.2
    hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
    hl.Parent = root
    
    npcHighlights[model] = hl
end

local function isNPC(model)
    if not model or not model:IsA("Model") then 
        return false 
    end
    
    if not model:FindFirstChildWhichIsA("Humanoid", true) then 
        return false 
    end
    
    if game.Players:GetPlayerFromCharacter(model) then 
        return false 
    end
    
    return true
end

local function isNPCFeaturesEnabled()
    return isScanning or gracePeriodActive
end

Workspace.DescendantAdded:Connect(function(descendant)
    if not isNPCFeaturesEnabled() then 
        return 
    end
    
    if descendant:IsA("Humanoid") or descendant:IsA("Model") then
        task.delay(0.1, function()
            if not descendant.Parent or not descendant:IsDescendantOf(Workspace) then
                return
            end
            
            local model
            if descendant:IsA("Humanoid") then
                model = descendant.Parent
            elseif descendant:IsA("Model") then
                model = descendant
            end
            
            if model and isNPC(model) and not Cache.TrackedNPCs[model] then
                Cache.TrackedNPCs[model] = true
                applyToNPC(model)
            end
        end)
    end
end)

local tool = Instance.new("Tool")
tool.Name = "UAV Scanner"
tool.RequiresHandle = true
tool.Parent = backpack

local handle = Instance.new("Part")
handle.Name = "Handle"
handle.Size = Vector3.new(0.4, 1.2, 0.4)
handle.Material = Enum.Material.Neon
handle.Color = Color3.fromRGB(80, 80, 255)
handle.Transparency = 0.4
handle.CanCollide = false
handle.Parent = tool

local drone = nil
local highlights = {}
local isEquipped = false
local isScanning = false
local gracePeriodActive = false
local despawnTimer = nil
local espCycleThread = nil
local isPulseOn = false

local function clearESP()
    for _, hl in pairs(highlights) do
        pcall(function() hl:Destroy() end)
    end
    highlights = {}
end

local function clearNPCHighlights()
    for model, hl in pairs(npcHighlights) do
        if hl and hl.Parent then
            pcall(function() hl:Destroy() end)
        end
    end
    npcHighlights = {}
end

local function fullCleanup()
    clearESP()
    clearNPCHighlights()
    if drone and drone.Parent then
        pcall(function() drone:Destroy() end)
    end
    drone = nil
    if despawnTimer then
        task.cancel(despawnTimer)
        despawnTimer = nil
    end
    gracePeriodActive = false
    isScanning = false
    Cache.TrackedNPCs = {}  
end

local function spawnDrone()
    if drone then drone:Destroy() end

    drone = Instance.new("Part")
    drone.Name = "UAV_Drone"
    drone.Size = Vector3.new(1,1,1)
    drone.Shape = Enum.PartType.Ball
    drone.Material = Enum.Material.Neon
    drone.Color = Color3.fromRGB(100, 220, 100)
    drone.Transparency = 0.4
    drone.CanCollide = false
    drone.Anchored = false
    local charRoot = player.Character and (player.Character:FindFirstChild("HumanoidRootPart") or player.Character.PrimaryPart)
    drone.Position = (charRoot and charRoot.Position or Vector3.new(0,100,0)) + Vector3.new(0, 40, 0)
    drone.Parent = Workspace

    local bv = Instance.new("BodyVelocity")
    bv.MaxForce = Vector3.new(1e5, 1e5, 1e5)
    bv.Velocity = Vector3.new()
    bv.Parent = drone

    task.spawn(function()
        while drone and drone.Parent do
            local dir = Vector3.new(
                math.random(-1,1),
                math.random(0.2,1),
                math.random(-1,1)
            ).Unit
            local speed = math.random(18, 36)
            bv.Velocity = dir * speed

            task.wait(math.random(4, 9))
        end
    end)
end

local function doESPPulse()
    clearESP()
    for _, p in ipairs(Players:GetPlayers()) do
        if p ~= player and p.Character then
            local root = p.Character:FindFirstChild("HumanoidRootPart")
            if root then
                local hl = Instance.new("Highlight")
                hl.Name = "UAVHighlight"
                hl.FillColor = Color3.fromRGB(255, 40, 40)
                hl.OutlineColor = Color3.fromRGB(255, 220, 60)
                hl.FillTransparency = 0.6
                hl.OutlineTransparency = 0.1
                hl.Adornee = p.Character
                hl.Parent = root
                table.insert(highlights, hl)
            end
        end
    end
end

local function doNPCPulse()
    for model in pairs(Cache.TrackedNPCs) do
        if model and model.Parent then
            applyToNPC(model)
        else
            Cache.TrackedNPCs[model] = nil
            npcHighlights[model] = nil
        end
    end
end

local function startScanning()
    if espCycleThread then
        task.cancel(espCycleThread)
    end

    for _, obj in ipairs(workspace:GetDescendants()) do
        if obj:IsA("Humanoid") or obj:IsA("Model") then
            local model = obj:IsA("Humanoid") and obj.Parent or obj
            if model and isNPC(model) and not Cache.TrackedNPCs[model] then
                Cache.TrackedNPCs[model] = true
    
                local humanoid = model:FindFirstChildWhichIsA("Humanoid")
                if humanoid then
                    humanoid.Died:Once(function()
                        Cache.TrackedNPCs[model] = nil
                        local hl = npcHighlights[model]
                        if hl then hl:Destroy() end
                        npcHighlights[model] = nil
                    end)
                end
    
                local ancestryConn
                ancestryConn = model.AncestryChanged:Connect(function()
                    if not model:IsDescendantOf(game) then
                        ancestryConn:Disconnect()
                        Cache.TrackedNPCs[model] = nil
                        local hl = npcHighlights[model]
                        if hl then hl:Destroy() end
                        npcHighlights[model] = nil
                    end
                end)
    
                if isPulseOn then
                    applyToNPC(model)
                end
            end
        end
    end

    espCycleThread = task.spawn(function()
        while isScanning and (isEquipped or gracePeriodActive) do
            isPulseOn = true
            doESPPulse()   
            doNPCPulse()   
            task.wait(3)
            isPulseOn = false
            clearESP()     
            clearNPCHighlights()  
            task.wait(2)
        end
        clearESP()
        clearNPCHighlights()
    end)
end

tool.Equipped:Connect(function()
    isEquipped = true
    if despawnTimer then
        task.cancel(despawnTimer)
        despawnTimer = nil
    end
    gracePeriodActive = false  
end)

tool.Unequipped:Connect(function()
    isEquipped = false
    if isScanning then
        gracePeriodActive = true
        despawnTimer = task.delay(60, fullCleanup)
    else
        fullCleanup()
    end
end)

tool.Activated:Connect(function()
    if not isScanning then
        isScanning = true
        spawnDrone()
        startScanning()
    end
end)

player.CharacterRemoving:Connect(fullCleanup)
Cache.TrackedNPCs = {}

Features & Information

"UAV entering the AO" Gives you a scanner tool Can also scan NPC's Might have HUGE LAG SPIKE when executing this script but will go smooth after that.

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts