Dota 2 Workshop Tools/Scripting/API/Global.FindUnitsInRadius: Difference between revisions
< Dota 2 Workshop Tools | Scripting | API
Jump to navigation
Jump to search
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
RoyAwesome (talk | contribs) (Dota_Lebot push: Updated Page) |
||
Line 14: | Line 14: | ||
;Example | ;Example | ||
<source lang="lua"> | <source lang="lua"> | ||
-- Find all Dire units | |||
direUnits = FindUnitsInRadius(DOTA_TEAM_BADGUYS, | |||
Vector(0, 0, 0), | |||
nil, | |||
FIND_UNITS_EVERYWHERE, | |||
DOTA_UNIT_TARGET_TEAM_FRIENDLY, | |||
DOTA_UNIT_TARGET_ALL, | |||
DOTA_UNIT_TARGET_FLAG_NONE, | |||
FIND_ANY_ORDER, | |||
false) | |||
-- Make the found units move to (0, 0, 0) | |||
for _,unit in pairs(direUnits) do | |||
unit:MoveToPosition(Vector(0, 0, 0)) | |||
end | |||
</source> | </source> | ||
== Parameters == | == Parameters == |
Revision as of 05:34, 18 August 2014

Function Description
table FindUnitsInRadius(int teamNumber, Vector position, handle cacheUnit, float radius, int teamFilter, int typeFilter, int flagFilter, int order, bool canGrowCache)
Finds the units in a given radius with the given flags. ( iTeamNumber, vPosition, hCacheUnit, flRadius, iTeamFilter, iTypeFilter, iFlagFilter, iOrder, bCanGrowCache )
- Example
-- Find all Dire units
direUnits = FindUnitsInRadius(DOTA_TEAM_BADGUYS,
Vector(0, 0, 0),
nil,
FIND_UNITS_EVERYWHERE,
DOTA_UNIT_TARGET_TEAM_FRIENDLY,
DOTA_UNIT_TARGET_ALL,
DOTA_UNIT_TARGET_FLAG_NONE,
FIND_ANY_ORDER,
false)
-- Make the found units move to (0, 0, 0)
for _,unit in pairs(direUnits) do
unit:MoveToPosition(Vector(0, 0, 0))
end
Parameters
Type | Name | Description |
---|---|---|
int | teamNumber | No Description Set |
Vector | position | No Description Set |
handle | cacheUnit | No Description Set |
float | radius | No Description Set |
int | teamFilter | No Description Set |
int | typeFilter | No Description Set |
int | flagFilter | No Description Set |
int | order | No Description Set |
bool | canGrowCache | No Description Set |
Returns
table - No Description Set