--// SERVICES \\--

local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")

local Mobs = workspace:FindFirstChild("Mobs")

local Target = nil

for i, v in ipairs(Mobs:GetDescendants()) do
    if v:IsA("Model") and v:FindFirstChild("Enemy") then
        local plr = Players.PlayerAdded:Wait()
        local char = plr.Character or plr.CharacterAdded:Wait()
        local humRp = char:FindFirstChild("HumanoidRootPart")
        
        local Enemy = v:FindFirstChild("Enemy")
        local enemyhumRp = v:FindFirstChild("HumanoidRootPart")

        local targetRange = v:GetAttribute("Range")

        function FindClosestPlayer(char, enemy, range)
            if Target == nil then
                Target = char
            end
        end

        FindClosestPlayer(char, Enemy, targetRange)
        
        
    end
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: