local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local enemies = workspace:WaitForChild("Enemies")
function Attack()
if not character then return end
local nearest
for _, mob in pairs(enemies:GetChildren()) do
local hrp = mob:FindFirstChild("HumanoidRootPart")
local hum = mob:FindFirstChild("Humanoid")
if hrp and hum and hum.Health > 0 then
local dist = (character.HumanoidRootPart.Position - hrp.Position).Magnitude
if dist <= 60 then
nearest = hrp
end
end
end
local attackId = tostring(math.random(100000,999999))
if nearest then
pcall(function()
local argsAttack = {0.1}
game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("Net"):WaitForChild("RE/RegisterAttack"):FireServer(unpack(argsAttack))
local argsHit = {nearest, {}, [4] = attackId}
game:GetService("ReplicatedStorage"):WaitForChild("Modules"):WaitForChild("Net"):WaitForChild("RE/RegisterHit"):FireServer(unpack(argsHit))
end)
end
end
while task.wait() do
Attack()
end
To embed this project on your website, copy the following code and paste it into your website's HTML: