ENT.Base = "base_nextbot" ENT.Type = "nextbot"
local dist = self:GetPos():DistToSqr(ply:GetPos()) if dist < nearestDist ^ 2 then nearest = ply nearestDist = math.sqrt(dist) end end Nico-s Nextbots Script
-- ----------------------------------------------------------------- -- Attack routine – plays a scream and damages the player -- ----------------------------------------------------------------- function ENT:AttackTarget() if not IsValid(self.CurrentTarget) then return end tolerance = CONFIG.AttackDistance
if distToTarget > CONFIG.LoseRadius ^ 2 then -- Too far – give up and look for another player self.CurrentTarget = nil coroutine.yield() else -- 3️⃣ Move toward the player self:MoveToPos(self.CurrentTarget:GetPos(), tolerance = CONFIG.AttackDistance, timeout = 10, repath = 1, maxage = 2, goalpos = self.CurrentTarget:GetPos() ) timeout = 10