local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
local Window = Rayfield:CreateWindow({
Name = "Apex Hub | Auto Attack",
LoadingTitle = "Loading Interface...",
LoadingSubtitle = "by GreenVR512",
ConfigurationSaving = {
Enabled = false
},
KeySystem = false
})
local Tab = Window:CreateTab("Main Features", 4483362458) -- Title, Image
-- Script Variables
local AutoAttackEnabled = false
local AttackRange = 45
local AttackDelay = 0.05
-- Services & References
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local p = Players.LocalPlayer
local Event = RS:WaitForChild("Events"):WaitForChild("GameRemoteFunction")
-- UI Controls
local Toggle = Tab:CreateToggle({
Name = "Enable Kill Aura / Auto Attack",
CurrentValue = false,
Flag = "KillAuraToggle",
Callback = function(Value)
AutoAttackEnabled = Value
end,
})
local RangeSlider = Tab:CreateSlider({
Name = "Attack Range",
Range = {10, 100},
Increment = 5,
Suffix = " Studs",
CurrentValue = 45,
Flag = "RangeSlider",
Callback = function(Value)
AttackRange = Value
end,
})
local SpeedSlider = Tab:CreateSlider({
Name = "Attack Speed (Delay)",
Range = {0.01, 0.5},
Increment = 0.01,
Suffix = "s",
CurrentValue = 0.05,
Flag = "SpeedSlider",
Callback = function(Value)
AttackDelay = Value
end,
})
Tab:CreateButton({
Name = "Unload UI",
Callback = function()
AutoAttackEnabled = false
Rayfield:Destroy()
end,
})
-- Main Loop
task.spawn(function()
while true do
if AutoAttackEnabled then
local myChar = p.Character
local myRoot = myChar and myChar:FindFirstChild("HumanoidRootPart")
local tool = myChar and myChar:FindFirstChildOfClass("Tool")
if myRoot and tool then
local targets = {}
for _, v in pairs(workspace:GetChildren()) do
if v:FindFirstChild("Humanoid") and v:FindFirstChild("HumanoidRootPart") and v ~= myChar then
local dist = (v.HumanoidRootPart.Position - myRoot.Position).Magnitude
if dist 10 then
myRoot.CFrame = CFrame.new(myRoot.Position, v.HumanoidRootPart.Position)
end
table.insert(targets, {
direction = (v.HumanoidRootPart.Position - myRoot.Position).Unit,
isClosestEnemy = false,
origin = myRoot.Position,
enemyModel = v,
distance = dist,
knockback = 50
})
end
end
end
if #targets > 0 then
local payload = {
attackCycleData = { knockbackMul = 1, slowMult = 0.2, slowTime = 1.5, lungeMul = 1, attackTime = 0.1 },
knockback = 50, shouldLock = true, slowTime = 1.5, shouldLunge = true, isCritical = true,
weaponDefinition = {
attackCycle = {
["1"] = { knockbackMul = 1, slowMult = 0.2, slowTime = 1.5, lungeMul = 1, attackTime = 0.1 },
["2"] = { lungeMult = 1, slowMult = 0.2, slowTime = 1.5, knockbackMult = 1, attackTime = 0.1 },
["3"] = { lungeMult = 0.75, slowMult = 0.2, slowTime = 1.5, knockbackMult = 1.5, attackTime = 0.1 },
["4"] = { lungeMult = 2.25, slowTime = 1.5, slowMult = 0.2, hitboxOffsetAdd = Vector3.new(0, 0, -1.5), hitboxSizeAdd = Vector3.new(0, 0, 3), knockbackMult = 2.25, attackTime = 0.1 }
},
attackOrder = {"1", "2", "3", "4"}
},
attackCooldown = 0,
shouldSlow = true,
lungeKnockback = 55,
hitboxSize = Vector3.new(55, 25, 55),
slowMult = 0.2,
cycleIndex = 1,
hitboxOffset = Vector3.new(0, 0, -10),
tool = tool,
damage = 100
}
pcall(function() Event:InvokeServer("AttemptWeaponHit", payload, targets) end)
end
end
end
task.wait(AttackDelay)
end
end)