defineStat
Function of @v12-engine/engine
ts
export declare function defineStat(def: ScoreStatDef): ScoreStatDef;A stat of the game's own, for RuleSettings.score: defineStat( id: 'towersLost', label: 'Towers lost', category: 'units', from: scoreOn(entityDied, ( entity ) = entity.def.tags?.includes('tower') ? entity.owner : undefined) ). One with no source is counted in code (world.score.add(player, 'towersLost'))