Skip to content

Instantly share code, notes, and snippets.

@Rectus
Created January 4, 2018 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rectus/8d7604f350c824e45ec5ce378ed09264 to your computer and use it in GitHub Desktop.
Save Rectus/8d7604f350c824e45ec5ce378ed09264 to your computer and use it in GitHub Desktop.
ATTACK_RADIUS <- 128
THINK_INTERVAL <- 1.0
function CommonAttack()
{
local infected = null
local commandTable =
{
bot = null
target = self
cmd = DirectorScript.BOT_CMD_ATTACK
}
local origin = self.GetOrigin()
while(infected = Entities.FindByClassnameWithin(infected, "infected", origin, ATTACK_RADIUS))
{
commandTable.bot = infected
CommandABot(commandTable)
}
return THINK_INTERVAL
}
AddThinkToEnt(self, "CommonAttack")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment