Ability Values
Needs the internal running and needs_internal = true in script_info. Local player only.
p:get_ability_value(slot, "PropertyName") -> number | nilReturns the resolved value of one ability property, with bought upgrade tiers and spirit power applied. This is the number the in-game tooltip shows. p:get_ability_properties(slot) (external, on the Player page) returns the base values before upgrades.
slot is an integer: 0 to 3 for abilities, 4 to 7 for active items, the same numbering as p:get_ability(slot). A string raises an error. Weapon slots 20 to 22 always return nil.
input.cast counts from 1
input.cast(1) is the ability that is slot 0 here.
Property names are the game's own. Call p:get_ability_properties(slot) to list the ones an ability has. Common names: AbilityCooldown, AbilityCharges, AbilityCastRange, AbilityRadius, Damage, HeadshotBonus, TimeToFullCharge.
Units are the property's own: seconds for AbilityCooldown and TimeToFullCharge, raw damage for Damage, a count for AbilityCharges (0 means no charge system), percent for names ending in Pct or Percent and for HeadshotBonus.
Returns nil when
- the internal is not running, or the flag is missing
- the player is not the local player
- the slot is empty
- the property does not exist on that ability
- it is the first call for that (slot, property). The first call registers it; a later call gets the value, usually within a quarter of a second
- the property name is 48 characters or longer
- 24 pairs are already registered across all scripts
The answer is never 0, so a real zero and a failed read stay distinct.
Limits
- 24 (slot, property) pairs across all scripts. The 25th is refused and logged once.
- Values refresh within 250 ms.
- A pair nobody asked for in 10 seconds is dropped. Asking again re-registers it.
Example
Read a fixed set of properties for the ult slot once a second:
local VINDICTA = { "AbilityCharges", "Damage", "HeadshotBonus",
"LowHealthEnemyDamageBonus", "LowHealthEnemyThresholdPct",
"MinChargeDamagePercent", "TimeToFullCharge" }
local props, next_props = {}, 0
local function refresh_props(me)
for _, k in ipairs(VINDICTA) do props[k] = me:get_ability_value(3, k) end
end
function on_tick()
local me = local_player()
if not me or not internal.is_loaded() then return end
local t = clock()
if t >= next_props then next_props = t + 1.0; refresh_props(me) end
if props.Damage then
draw.text(40, 300, string.format("Damage %.0f charges %.0f", props.Damage, props.AbilityCharges or 0), 0xFFFFFFFF)
end
endThe first pass returns nil for every key; the values arrive on a later pass.