Cube Scripts

Territories

How gangs gain influence and take control of a zone.

A territory is a polygon drawn in the creator. Every gang has an influence in every territory, from 0 to Config.Territories.maxInfluence. The gang with the most influence above minOwnership owns the territory.

Ownership#

config.luaLua
Config.Territories = {
    enabled = true,
    maxInfluence = 100.0,
    minOwnership = 25.0,
    contest = 0.5,
    decay = { interval = 60, amount = 2.0 },
    payoutInterval = 60,
}
  • A gang becomes the owner as soon as it has the highest influence and at

    least minOwnership.

  • The owner keeps the territory as long as nobody passes it. A tie never changes

    the owner.

  • If the owner drops below minOwnership and nobody else reaches it, the

    territory becomes neutral.

When the owner changes, the gang that captured the zone receives Config.Points.zoneCaptured and the previous owner receives Config.Points.zoneLost. Every payoutInterval minutes, each owned territory gives Config.Points.zoneOwned to its owner.

Contest#

With contest = 0.5, every influence gained by a gang removes half of that amount from every other gang in the same territory. Taking a zone back from a strong owner is faster than building influence in an empty zone.

Set it to 0 to disable the contest: gangs then grow their influence independently.

Decay#

Every decay.interval minutes, every gang loses decay.amount influence in every territory. A gang that stops being active slowly loses its zones.

Influence sources#

SourceConfigured inDefault
Drug salesConfig.Drugs.items[].influence+1 to +2 per unit sold
PresenceConfig.Influence.presence+0.5 per member, every 5 min
KillsConfig.Influence.kills+4 for the killer, -2 for the victim's gang
RobberiesConfig.Influence.robberiesper robbery type
Your scriptsServer exports-

Presence#

config.luaLua
presence = {
    enabled = true,
    interval = 5,
    amount = 0.5,
    maxMembers = 4,
    ignoreDead = true,
},

Every interval minutes, each gang gains amount influence per member standing in a territory, counting at most maxMembers members per gang and per zone. maxMembers stops a large gang from taking a zone just by standing in it.

Kills#

config.luaLua
kills = {
    enabled = true,
    influence = 4.0,
    victimLoss = 2.0,
    points = 5,
    rivalsOnly = true,
    zoneOnly = true,
    maxDistance = 300.0,
    cooldown = 300,
},

When a gang member kills another player:

  • the zone is the one where the victim died;
  • the killer's gang gains influence and points, the victim's gang loses

    victimLoss;

  • with rivalsOnly, only victims from another gang count - killing civilians

    gives nothing;

  • with zoneOnly, kills outside every territory give nothing at all;
  • the same killer and victim only count once every cooldown seconds, so a kill

    loop cannot be farmed.

Note

The kill is reported by the killer's game and verified by the server: the victim must really be dead and within maxDistance of the killer. Teammates never count.

Robberies#

See Robberies & activities.

On the map#

Every territory is drawn on the minimap and the pause map with the color and the logo of its owner. On the pause map, hovering a territory shows its owner, the influence of every gang and the current drug demand.

Players can hide the territories with /gangzones or the G key on the pause map. See Configuration to restrict who sees them.