Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Ant wars
- local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))()
- local Players = game:GetService("Players")
- local ReplicatedStorage = game:GetService("ReplicatedStorage")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local Workspace = workspace
- local LocalPlayer = Players.LocalPlayer
- -- REMOTES (edit here if needed)
- local ServerEvents = ReplicatedStorage:WaitForChild("ServerEvents")
- local BiteRemote = ServerEvents:WaitForChild("Bite")
- local DigRemote = ServerEvents:WaitForChild("Dig")
- local AcidRemote = ServerEvents:WaitForChild("Acid") -- note: uses InvokeServer in your sample
- -- QUEEN TEAMS / PATH
- local QueenTeams = {"Fire Nation","Golden Empire","Leaf Kingdom","Concrete Clan"}
- local QueenBasePath = {"Map","Chambers"} -- workspace.Map.Chambers.<Team>.Queen
- -- CONFIG / STATE
- local cfg = {
- -- Kill aura
- killAuraEnabled = false,
- killRange = 18,
- biteDelay = 0.12,
- teamCheck = true,
- healthCheck = true, -- only bite if target humanoid health > 0
- -- Queen
- queenAuraEnabled = false,
- queenRange = 100,
- queenDelay = 0.4,
- -- Acid
- acidEnabled = false,
- acidRange = 120,
- acidDelay = 0.6,
- -- Dig
- digEnabled = false,
- digRadius = 10,
- digDelay = 0.06,
- digMode = "Tunnel", -- "Tunnel" or "Bubble"
- digRandomize = false,
- -- ESP
- espEnabled = false,
- espRefresh = 0.06,
- espShowNames = true,
- espShowTracers = true,
- espShow2D = true,
- espShow3D = true,
- espColorEnemy = Color3.fromRGB(255,80,80),
- espColorAlly = Color3.fromRGB(120,220,120),
- queenESPEnabled = false,
- queenESPColor = Color3.fromRGB(255,200,60),
- }
- -- DRAWING STORAGE
- local espStore = {} -- [player] = {name, tracer, box2d_lines..., box3d_lines...}
- local queenHighlights = {} -- [queenModel] = Highlight
- -- UTIL
- local function isValidCharacter(char)
- return char and char:FindFirstChild("Humanoid") and char:FindFirstChild("HumanoidRootPart")
- end
- local function isEnemy(player)
- if not player or player == LocalPlayer then return false end
- if not player.Character or not player.Character:FindFirstChild("Humanoid") then return false end
- if cfg.teamCheck and player.Team == LocalPlayer.Team then return false end
- if cfg.healthCheck and player.Character.Humanoid.Health <= 0 then return false end
- return true
- end
- local function getNearestEnemyWithin(range)
- local best, bestDist = nil, range or math.huge
- if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then return nil end
- local origin = LocalPlayer.Character.HumanoidRootPart.Position
- for _, plr in ipairs(Players:GetPlayers()) do
- if isEnemy(plr) then
- local root = plr.Character:FindFirstChild("HumanoidRootPart")
- if root then
- local d = (root.Position - origin).Magnitude
- if d < bestDist then
- bestDist = d
- best = plr
- end
- end
- end
- end
- return best, bestDist
- end
- local function getQueenModelsInRange(range)
- local results = {}
- if not LocalPlayer.Character or not LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then return results end
- local origin = LocalPlayer.Character.HumanoidRootPart.Position
- for _, teamName in ipairs(QueenTeams) do
- local success, teamFolder = pcall(function()
- return Workspace:FindFirstChild("Map") and Workspace.Map:FindFirstChild("Chambers") and Workspace.Map.Chambers:FindFirstChild(teamName)
- end)
- if success and teamFolder then
- local queen = teamFolder:FindFirstChild("Queen")
- if queen and queen:FindFirstChild("HumanoidRootPart") and queen:FindFirstChild("Humanoid") then
- if cfg.teamCheck and teamName == (LocalPlayer.Team and LocalPlayer.Team.Name or "") then
- -- skip own queen
- else
- local d = (queen.HumanoidRootPart.Position - origin).Magnitude
- if d <= range then
- table.insert(results, queen)
- end
- end
- end
- end
- end
- return results
- end
- -- 3D BOX HELPERS
- local function worldToScreenVector(v)
- local cam = Workspace.CurrentCamera
- local p = cam:WorldToViewportPoint(v)
- return Vector2.new(p.X, p.Y), p.Z > 0
- end
- local function make3DBoxCorners(hrp, size)
- -- hrp: Instance (HumanoidRootPart) ; size: Vector3 extents (half-size)
- local cf = hrp.CFrame
- local sx, sy, sz = size.X, size.Y, size.Z
- local offs = {
- Vector3.new( sx, sy, sz),
- Vector3.new( sx, sy, -sz),
- Vector3.new(-sx, sy, -sz),
- Vector3.new(-sx, sy, sz),
- Vector3.new( sx, -sy, sz),
- Vector3.new( sx, -sy, -sz),
- Vector3.new(-sx, -sy, -sz),
- Vector3.new(-sx, -sy, sz),
- }
- local corners = {}
- for i=1,8 do
- corners[i] = (cf * CFrame.new(offs[i])).p
- end
- return corners
- end
- local function draw3DBoxForPlayer(player, color)
- if not player or not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then return end
- local hrp = player.Character.HumanoidRootPart
- -- size estimate: use Humanoid.HipHeight + extents approx
- local size = Vector3.new(1.5, (player.Character.Humanoid and player.Character.Humanoid.HipHeight or 2) + 1, 1.0)
- local corners = make3DBoxCorners(hrp, size)
- local to2d = {}
- local cam = Workspace.CurrentCamera
- for i, c in ipairs(corners) do
- local p, vis = cam:WorldToViewportPoint(c)
- to2d[i] = {pos = Vector2.new(p.X, p.Y), vis = vis}
- end
- -- edges pairs
- local edges = {
- {1,2},{2,3},{3,4},{4,1}, -- top
- {5,6},{6,7},{7,8},{8,5}, -- bottom
- {1,5},{2,6},{3,7},{4,8} -- sides
- }
- local lines = {}
- for _, e in ipairs(edges) do
- local a, b = e[1], e[2]
- local A, B = to2d[a], to2d[b]
- if A and B and A.vis and B.vis then
- local ln = Drawing.new("Line")
- ln.From = A.pos
- ln.To = B.pos
- ln.Color = color
- ln.Thickness = 1.6
- ln.Transparency = 1
- table.insert(lines, ln)
- end
- end
- return lines
- end
- -- 2D BOX helper: simple top/bottom projection
- local function draw2DBoxForPlayer(player, color)
- if not player or not player.Character or not player.Character:FindFirstChild("HumanoidRootPart") then return end
- local cam = Workspace.CurrentCamera
- local root = player.Character.HumanoidRootPart
- local head = player.Character:FindFirstChild("Head")
- if not head then return end
- local topPos, topVis = cam:WorldToViewportPoint(head.Position + Vector3.new(0,0.5,0))
- local bottomPos, bottomVis = cam:WorldToViewportPoint(root.Position - Vector3.new(0,1,0))
- if not topVis or not bottomVis then return nil end
- local height = math.abs(topPos.Y - bottomPos.Y)
- local width = math.clamp(height/2.2, 20, 200)
- local x = topPos.X - width/2
- local y = topPos.Y
- local rectLines = {}
- -- four edges
- local tl = Vector2.new(x, y)
- local tr = Vector2.new(x + width, y)
- local bl = Vector2.new(x, y + height)
- local br = Vector2.new(x + width, y + height)
- local pts = {{tl,tr},{tr,br},{br,bl},{bl,tl}}
- for _, p in ipairs(pts) do
- local ln = Drawing.new("Line")
- ln.From = p[1]
- ln.To = p[2]
- ln.Color = color
- ln.Thickness = 1.6
- ln.Transparency = 1
- table.insert(rectLines, ln)
- end
- return rectLines, Vector2.new(x + width/2, y + height + 4) -- return center-bottom for name label
- end
- -- ESP Management
- local function clearPlayerESP(player)
- local s = espStore[player]
- if s then
- if s.nameLabel then s.nameLabel:Remove() end
- if s.tracer then s.tracer:Remove() end
- if s.box2d then
- for _, ln in ipairs(s.box2d) do ln:Remove() end
- end
- if s.box3d then
- for _, ln in ipairs(s.box3d) do ln:Remove() end
- end
- espStore[player] = nil
- end
- end
- local function createOrUpdatePlayerESP(player)
- if not player or not player.Character then return end
- local color = (player.Team == LocalPlayer.Team) and cfg.espColorAlly or cfg.espColorEnemy
- espStore[player] = espStore[player] or {}
- local s = espStore[player]
- -- name label
- if cfg.espShowNames then
- if s.nameLabel == nil then
- local nameText = Drawing.new("Text")
- nameText.Center = true
- nameText.Size = 14
- nameText.Font = 2
- nameText.Outline = true
- nameText.OutlineColor = Color3.new(0,0,0)
- s.nameLabel = nameText
- end
- local cam = Workspace.CurrentCamera
- local head = player.Character:FindFirstChild("Head")
- if head then
- local p = cam:WorldToViewportPoint(head.Position + Vector3.new(0,0.6,0))
- local vis = p.Z > 0
- s.nameLabel.Text = player.Name
- s.nameLabel.Position = Vector2.new(p.X, p.Y - 12)
- s.nameLabel.Visible = vis
- s.nameLabel.Color = color
- end
- else
- if s.nameLabel then s.nameLabel:Remove(); s.nameLabel = nil end
- end
- -- tracer
- if cfg.espShowTracers then
- if s.tracer == nil then
- local ln = Drawing.new("Line")
- ln.Thickness = 1
- ln.Transparency = 1
- ln.Color = color
- s.tracer = ln
- end
- local cam = Workspace.CurrentCamera
- local root = player.Character:FindFirstChild("HumanoidRootPart")
- if root then
- local p = cam:WorldToViewportPoint(root.Position)
- local vis = p.Z > 0
- s.tracer.From = Vector2.new(LocalPlayer:GetMouse().X, LocalPlayer:GetMouse().Y + game:GetService("GuiService"):GetGuiInset().Y)
- s.tracer.To = Vector2.new(p.X, p.Y)
- s.tracer.Visible = vis
- s.tracer.Color = color
- end
- else
- if s.tracer then s.tracer:Remove(); s.tracer = nil end
- end
- -- 2D box
- if cfg.espShow2D then
- if s.box2d then
- for _, ln in ipairs(s.box2d) do ln:Remove() end
- s.box2d = nil
- end
- local rect, namePos = draw2DBoxForPlayer(player, color)
- if rect then
- s.box2d = rect
- end
- else
- if s.box2d then for _, ln in ipairs(s.box2d) do ln:Remove() end s.box2d = nil end
- end
- -- 3D box
- if cfg.espShow3D then
- if s.box3d then
- for _, ln in ipairs(s.box3d) do ln:Remove() end
- s.box3d = nil
- end
- local lines = draw3DBoxForPlayer(player, color)
- if lines then s.box3d = lines end
- else
- if s.box3d then for _, ln in ipairs(s.box3d) do ln:Remove() end s.box3d = nil end
- end
- end
- -- Queen ESP: highlight + 3D box
- local function clearAllQueenESP()
- for model, highlight in pairs(queenHighlights) do
- if highlight and highlight.Parent then highlight:Destroy() end
- end
- queenHighlights = {}
- end
- local function applyQueenESPForModel(queenModel)
- if not queenModel or not queenModel:FindFirstChild("HumanoidRootPart") then return end
- if queenHighlights[queenModel] then return end
- local hl = Instance.new("Highlight")
- hl.Name = "CapybaraQueenHighlight"
- hl.Adornee = queenModel
- hl.FillColor = cfg.queenESPColor
- hl.OutlineColor = Color3.new(1,1,1)
- hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- hl.Parent = queenModel
- queenHighlights[queenModel] = hl
- end
- -- CLEANUP ON PLAYER JOIN/LEAVE
- Players.PlayerRemoving:Connect(function(plr) clearPlayerESP(plr) end)
- -- MAIN LOOPS
- -- Kill Aura loop
- task.spawn(function()
- while task.wait(cfg.biteDelay) do
- if cfg.killAuraEnabled then
- local target, dist = getNearestEnemyWithin(cfg.killRange)
- if target and target.Character and target.Character:FindFirstChild("HumanoidRootPart") and target.Character:FindFirstChild("Humanoid") then
- -- fire Bite remote
- pcall(function()
- BiteRemote:FireServer("Bite", target.Character.Humanoid, target.Character.HumanoidRootPart)
- end)
- end
- end
- end
- end)
- -- Queen Kill Aura loop
- task.spawn(function()
- while task.wait(cfg.queenDelay) do
- if cfg.queenAuraEnabled then
- local queens = getQueenModelsInRange(cfg.queenRange)
- for _, q in ipairs(queens) do
- if q and q:FindFirstChild("Humanoid") and q:FindFirstChild("HumanoidRootPart") then
- pcall(function()
- BiteRemote:FireServer("Bite", q.Humanoid, q.HumanoidRootPart)
- end)
- end
- end
- end
- end
- end)
- -- Acid aimbot loop
- task.spawn(function()
- while task.wait(cfg.acidDelay) do
- if cfg.acidEnabled then
- local enemy, dist = getNearestEnemyWithin(cfg.acidRange)
- if enemy and enemy.Character and enemy.Character:FindFirstChild("HumanoidRootPart") then
- local pos = enemy.Character.HumanoidRootPart.Position
- pcall(function()
- AcidRemote:InvokeServer(pos)
- end)
- end
- end
- end
- end)
- -- Dig aura loop (optimized sampling)
- local function sampleDigPositions(origin, radius, mode)
- local positions = {}
- local step = 2 -- spacing for samples; lower = more calls
- if mode == "Tunnel" then
- -- sample disc around player at y=origin.Y
- for x = -radius, radius, step do
- for z = -radius, radius, step do
- local p = origin + Vector3.new(x, 0, z)
- if (p - origin).Magnitude <= radius then
- table.insert(positions, p)
- end
- end
- end
- else
- -- Bubble: sample sphere surface/volume
- for x = -radius, radius, step do
- for y = -radius, radius, step do
- for z = -radius, radius, step do
- local offs = Vector3.new(x, y, z)
- if offs.Magnitude <= radius then
- table.insert(positions, origin + offs)
- end
- end
- end
- end
- end
- return positions
- end
- task.spawn(function()
- while task.wait(cfg.digDelay) do
- if cfg.digEnabled then
- if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then
- local origin = LocalPlayer.Character.HumanoidRootPart.Position
- local positions = sampleDigPositions(origin, cfg.digRadius, cfg.digMode)
- for _, pos in ipairs(positions) do
- local finalPos = pos
- if cfg.digRandomize then
- finalPos = pos + Vector3.new(math.random()-0.5, math.random()-0.5, math.random()-0.5)
- end
- pcall(function()
- DigRemote:FireServer(finalPos)
- end)
- end
- end
- end
- end
- end)
- -- ESP render loop
- local espAcc = 0
- RunService.RenderStepped:Connect(function(dt)
- if cfg.espEnabled then
- espAcc = espAcc + dt
- if espAcc >= cfg.espRefresh then
- espAcc = 0
- for _, plr in ipairs(Players:GetPlayers()) do
- if plr ~= LocalPlayer and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
- if isEnemy(plr) or (not cfg.teamCheck) then
- createOrUpdatePlayerESP(plr)
- else
- clearPlayerESP(plr)
- end
- else
- clearPlayerESP(plr)
- end
- end
- end
- else
- -- clean visuals if disabled
- for plr, _ in pairs(espStore) do clearPlayerESP(plr) end
- end
- -- Queen ESP handling
- if cfg.queenESPEnabled then
- clearAllQueenESP()
- for _, qmodel in ipairs(getQueenModelsInRange(99999)) do
- applyQueenESPForModel(qmodel)
- -- optional 3D box via Drawing (we can draw edges similarly)
- if cfg.espShow3D then
- -- approximate by drawing cube at queen's hrp
- local lines = draw3DBoxForPlayer({Character = qmodel}, cfg.queenESPColor) -- hack: draw3DBoxForPlayer expects player but uses Character
- if lines then
- -- keep them for single frame; remove next tick
- delay(cfg.espRefresh, function() for _,ln in ipairs(lines) do ln:Remove() end end)
- end
- end
- end
- else
- clearAllQueenESP()
- end
- end)
- -- Player join handler to initialize ESP when toggled
- Players.PlayerAdded:Connect(function(plr)
- if cfg.espEnabled then
- -- will be processed on next render tick
- end
- end)
- -- UI
- local Window = Rayfield:CreateWindow({
- Name = "Capybara Hub | Ant Wars",
- LoadingTitle = "Capybara Hub",
- LoadingSubtitle = "Open source, Safe, Free, Undetected",
- ConfigurationSaving = {
- Enabled = true,
- FolderName = "CapybaraHub_AntWars",
- FileName = "Config"
- },
- ToggleUIKeybind = "K"
- })
- -- Combat Tab
- local TabCombat = Window:CreateTab("Combat", 4483362458)
- local SecKA = TabCombat:CreateSection("Player Kill Aura")
- TabCombat:CreateToggle({ Name = "Enable Kill Aura", CurrentValue = false, Callback = function(v) cfg.killAuraEnabled = v end })
- TabCombat:CreateSlider({ Name = "Kill Range", Range = {5, 60}, Increment = 1, CurrentValue = cfg.killRange, Callback = function(v) cfg.killRange = v end })
- TabCombat:CreateSlider({ Name = "Bite Delay (s)", Range = {0.05, 0.5}, Increment = 0.01, CurrentValue = cfg.biteDelay, Callback = function(v) cfg.biteDelay = v end })
- TabCombat:CreateToggle({ Name = "Team Check (Don't hit teammates)", CurrentValue = cfg.teamCheck, Callback = function(v) cfg.teamCheck = v end })
- TabCombat:CreateToggle({ Name = "Require Health > 0", CurrentValue = cfg.healthCheck, Callback = function(v) cfg.healthCheck = v end })
- local SecQueen = TabCombat:CreateSection("Queen Kill Aura")
- TabCombat:CreateToggle({ Name = "Enable Queen Kill Aura", CurrentValue = false, Callback = function(v) cfg.queenAuraEnabled = v end })
- TabCombat:CreateSlider({ Name = "Queen Range", Range = {20, 300}, Increment = 1, CurrentValue = cfg.queenRange, Callback = function(v) cfg.queenRange = v end })
- TabCombat:CreateSlider({ Name = "Queen Bite Delay (s)", Range = {0.05, 1}, Increment = 0.01, CurrentValue = cfg.queenDelay, Callback = function(v) cfg.queenDelay = v end })
- local SecAcid = TabCombat:CreateSection("Acid Aimbot")
- TabCombat:CreateToggle({ Name = "Enable Acid Aimbot", CurrentValue = false, Callback = function(v) cfg.acidEnabled = v end })
- TabCombat:CreateSlider({ Name = "Acid Range", Range = {20, 300}, Increment = 1, CurrentValue = cfg.acidRange, Callback = function(v) cfg.acidRange = v end })
- TabCombat:CreateSlider({ Name = "Acid Delay (s)", Range = {0.05, 2}, Increment = 0.01, CurrentValue = cfg.acidDelay, Callback = function(v) cfg.acidDelay = v end })
- -- Dig Tab
- local TabDig = Window:CreateTab("Dig Aura", 4483362458)
- TabDig:CreateToggle({ Name = "Enable Dig Aura", CurrentValue = false, Callback = function(v) cfg.digEnabled = v end })
- TabDig:CreateSlider({ Name = "Dig Radius", Range = {3, 25}, Increment = 1, CurrentValue = cfg.digRadius, Callback = function(v) cfg.digRadius = v end })
- TabDig:CreateDropdown({ Name = "Dig Mode", Options = {"Tunnel","Bubble"}, CurrentOption = {cfg.digMode}, Callback = function(opt) cfg.digMode = opt[1] end })
- TabDig:CreateToggle({ Name = "Randomize Positions", CurrentValue = false, Callback = function(v) cfg.digRandomize = v end })
- TabDig:CreateSlider({ Name = "Dig Delay (s)", Range = {0.01, 0.3}, Increment = 0.01, CurrentValue = cfg.digDelay, Callback = function(v) cfg.digDelay = v end })
- -- ESP Tab
- local TabESP = Window:CreateTab("ESP", 4483362458)
- TabESP:CreateToggle({ Name = "Enable Player ESP(Most likely will crash you dont use)", CurrentValue = false, Callback = function(v) cfg.espEnabled = v if not v then for p,_ in pairs(espStore) do clearPlayerESP(p) end end end })
- TabESP:CreateToggle({ Name = "Show Names", CurrentValue = true, Callback = function(v) cfg.espShowNames = v end })
- TabESP:CreateToggle({ Name = "Show Tracers", CurrentValue = true, Callback = function(v) cfg.espShowTracers = v end })
- TabESP:CreateToggle({ Name = "Show 2D Box", CurrentValue = true, Callback = function(v) cfg.espShow2D = v end })
- TabESP:CreateToggle({ Name = "Show 3D Box (edges)", CurrentValue = true, Callback = function(v) cfg.espShow3D = v end })
- TabESP:CreateSlider({ Name = "ESP Refresh Rate (s)", Range = {0.02, 0.2}, Increment = 0.01, CurrentValue = cfg.espRefresh, Callback = function(v) cfg.espRefresh = v end })
- TabESP:CreateColorPicker({ Name = "Enemy Color", Default = cfg.espColorEnemy, Callback = function(c) cfg.espColorEnemy = c end })
- TabESP:CreateColorPicker({ Name = "Ally Color", Default = cfg.espColorAlly, Callback = function(c) cfg.espColorAlly = c end })
- local TabQueenESP = Window:CreateTab("Queen ESP", 4483362458)
- TabQueenESP:CreateToggle({ Name = "Enable Queen ESP", CurrentValue = false, Callback = function(v) cfg.queenESPEnabled = v if not v then clearAllQueenESP() end end })
- TabQueenESP:CreateColorPicker({ Name = "Queen Color", Default = cfg.queenESPColor, Callback = function(c) cfg.queenESPColor = c end })
- -- Unload button
- TabCombat:CreateButton({ Name = "Unload Capybara Hub (cleanup)", Callback = function()
- -- cleanup drawings
- for p,_ in pairs(espStore) do clearPlayerESP(p) end
- clearAllQueenESP()
- Rayfield:Destroy()
- -- optional: attempt to clean created instances
- -- script destroy (if this script is a Script instance)
- pcall(function() script:Destroy() end)
- end })
Advertisement
Add Comment
Please, Sign In to add comment