Skip to content

Player ​

The Player class extends Entity with player state, gold, score, and order APIs.

NOTE

This page documents members declared directly on Player. Inherited members are available from Entity.


Methods ​

GetDenyCount()number ​

Retrieves the deny count.

Returned:

  • number - The requested deny count.

GetLastHitCount()number ​

Retrieves the last hit count.

Returned:

  • number - The requested last hit count.

GetAssignedHeroIndex()number ​

Retrieves the assigned hero index.

Returned:

  • number - The requested assigned hero index.

GetAssignedHero()Hero | null ​

Retrieves the assigned hero.

Returned:

  • Hero | null - The matching object, or null if it is not available.

GetActiveAbilityIndex()number ​

Retrieves the active ability index.

Returned:

  • number - The requested active ability index.

GetActiveAbility()Ability | null ​

Retrieves the active ability.

Returned:

  • Ability | null - The matching object, or null if it is not available.

GetQuickBuyItems()number[] ​

Retrieves the quick buy items.

Returned:

  • number[] - An array with the matching values.

GetAttachedQuickBuyItem()number ​

Retrieves the attached quick buy item.

Returned:

  • number - The requested attached quick buy item.

GetQuickBuyIsPurchasable()boolean[] ​

Retrieves the quick buy is purchasable.

Returned:

  • boolean[] - An array with the matching values.

GetPossibleHeroSelection()number ​

Retrieves the possible hero selection.

Returned:

  • number - The requested possible hero selection.

GetPlayerSelectedHeroName()string ​

Retrieves the player selected hero name.

Returned:

  • string - The requested player selected hero name.

GetSelectedHeroID()number ​

Retrieves the selected hero id.

Returned:

  • number - The requested selected hero id.

GetSelectedHeroFacetID()number ​

Retrieves the selected hero facet id.

Returned:

  • number - The requested selected hero facet id.

GetTeamSlot()number ​

Retrieves the team slot.

Returned:

  • number - The requested team slot.

GetReliableGold()number ​

Retrieves the reliable gold.

Returned:

  • number - The requested reliable gold.

GetUnreliableGold()number ​

Retrieves the unreliable gold.

Returned:

  • number - The requested unreliable gold.

GetTotalGold()number ​

Retrieves the total gold.

Returned:

  • number - The requested total gold.

GetNetWorth()number ​

Retrieves the net worth.

Returned:

  • number - The requested net worth.

GetCommandsIssued()number ​

Retrieves the commands issued.

Returned:

  • number - The requested commands issued.

IsValid()boolean ​

Checks whether it is valid.

Returned:

  • boolean - True if the condition is met, false otherwise.

IsFullyJoined()boolean ​

Checks whether it is fully joined.

Returned:

  • boolean - True if the condition is met, false otherwise.

IsFakeClient()boolean ​

Checks whether it is fake client.

Returned:

  • boolean - True if the condition is met, false otherwise.

GetConnectionState()number ​

Retrieves the connection state.

Returned:

  • number - The requested connection state.

GetRankTier()number ​

Retrieves the rank tier.

Returned:

  • number - The requested rank tier.

GetSteamID()bigint ​

Retrieves the steam id.

Returned:

  • bigint - The requested steam id.

GetSteamID32()number ​

Retrieves the steam id32.

Returned:

  • number - The requested steam id32.

GetPlayerID()number ​

Retrieves the player id.

Returned:

  • number - The requested player id.

GetName()string ​

Retrieves the name.

Returned:

  • string - The requested name.

GetKills()number ​

Retrieves the kills.

Returned:

  • number - The requested kills.

GetAssists()number ​

Retrieves the assists.

Returned:

  • number - The requested assists.

GetDeaths()number ​

Retrieves the deaths.

Returned:

  • number - The requested deaths.

GetStreak()number ​

Retrieves the streak.

Returned:

  • number - The requested streak.

GetRespawnTime()number ​

Retrieves the respawn time.

Returned:

  • number - The requested respawn time.

GetLaneSelectionFlags()number ​

Retrieves the lane selection flags.

Returned:

  • number - The requested lane selection flags.

IsMuted()boolean ​

Checks whether it is muted.

Returned:

  • boolean - True if the condition is met, false otherwise.

GetLastBuybackTime()number ​

Retrieves the last buyback time.

Returned:

  • number - The requested last buyback time.

GetBuybackCooldownTime()number ​

Retrieves the buyback cooldown time.

Returned:

  • number - The requested buyback cooldown time.

GetBuybackCostTime()number ​

Retrieves the buyback cost time.

Returned:

  • number - The requested buyback cost time.

GetBuybackGoldLimitTime()number ​

Retrieves the buyback gold limit time.

Returned:

  • number - The requested buyback gold limit time.

GetColor()Color ​

Retrieves the color.

Returned:

  • Color - The result of the call.

GetSelectedUnits()Array<NPC> ​

Retrieves the selected units.

Returned:

  • Array<NPC> - An array with the matching values.

AddSelectedUnit(unit: NPC)void ​

Adds the selected unit.

  • unitNPC - The unit to use.

RemoveSelectedUnit(unit: NPC)void ​

Removes the selected unit.

  • unitNPC - The unit to use.

ClearSelectedUnits()void ​

Clears the selected units.


CreateClickEffect(position: Vector, color: Color, orderType: Enum.UnitOrder, queue: boolean)void ​

Creates a click effect for the player.

  • positionVector - The position to use.
  • colorColor - The color value to use.
  • orderTypeEnum.UnitOrder - The order type.
  • queueboolean - Whether to queue the action.

PrepareUnitOrdersStructed(info: PrepareUnitOrdersInfo)OrderID ​

Prepares a structured unit order payload.

  • infoPrepareUnitOrdersInfo - The info.

Returned:

  • OrderID - The result of the call.

PrepareUnitOrdersUnsafe(orderType: Enum.UnitOrder, target: Entity | number | null, position: Vector | null, ability: Ability | number | null, units: NPC[], queue?: boolean, showEffects?: boolean)void ​

Prepares unit orders without additional safety checks.

  • orderTypeEnum.UnitOrder - The order type.
  • targetEntity | number | null - The target entity.
  • positionVector | null - The position to use.
  • abilityAbility | number | null - The ability.
  • unitsNPC[] - The units to use.
  • queueboolean (optional) - Whether to queue the action.
  • showEffectsboolean (optional) - Whether to show default game effects.

PrepareUnitOrders(orderType: Enum.UnitOrder, target: Entity | number | null, position: Vector | null, ability: Ability | number | null, orderIssuer: Enum.PlayerOrderIssuer, unit: Entity | null, queue?: boolean, showEffects?: boolean)void ​

Prepares unit orders using the standard order context.

  • orderTypeEnum.UnitOrder - The order type.
  • targetEntity | number | null - The target entity.
  • positionVector | null - The position to use.
  • abilityAbility | number | null - The ability.
  • orderIssuerEnum.PlayerOrderIssuer - The order issuer.
  • unitEntity | null - The unit to use.
  • queueboolean (optional) - Whether to queue the action.
  • showEffectsboolean (optional) - Whether to show default game effects.

HoldPosition(unit: Entity | null, queue?: boolean)void ​

Orders the unit to hold position.

  • unitEntity | null - The unit to use.
  • queueboolean (optional) - Whether to queue the action.

AttackTarget(unit: Entity | null, target: Entity | null, queue?: boolean)void ​

Orders the unit to attack the specified target.

  • unitEntity | null - The unit to use.
  • targetEntity | null - The target entity.
  • queueboolean (optional) - Whether to queue the action.