Kartik Scripts

Events

👂 Server events you can listen to

Listen to these on the server with AddEventHandler.

AddEventHandler('kartik-gangs:onTurfOwnerChanged', function(turfId, newOwnerId, oldOwnerId)
    print(('Turf %s taken by gang %s'):format(turfId, newOwnerId))
end)

Gangs

EventArguments
kartik-gangs:onGangCreatedgangId, name
kartik-gangs:onGangUpdatedgangId
kartik-gangs:onGangDeletedgangId, name
kartik-gangs:onGangLevelUpgangId, newLevel
kartik-gangs:onMemberJoinedcid, gangId, source (if online)
kartik-gangs:onMemberLeftcid, gangId, source (if online)
kartik-gangs:onGangTierChangedgangId, tierKey, promoted (true up, false down)

Territory

EventArguments
kartik-gangs:onTurfInfluenceturfId, gangId, change, reason
kartik-gangs:onTurfOwnerChangedturfId, newOwnerId, oldOwnerId
kartik-gangs:onHotspotCapturedhotspotId, gangId, players (list of server IDs)
kartik-gangs:onRacketCollectedsource, gangId, racketId, amount
kartik-gangs:onBusinessSalegangId, turfId, business, saleAmount, cut (after a BusinessSale pays a gang)
kartik-gangs:onGraffitiSprayedsource, gangId, tagId, coords
kartik-gangs:onGraffitiRemovedsource, removerGangId, tagId, ownerGangId, coords
kartik-gangs:onTurfCrimesource, kind (NpcKill, Robbery, Theft), turfId, gangId, info

Street & Underworld

EventArguments
kartik-gangs:onDrugSoldsource, { item, amount, price, coords }
kartik-gangs:onRobberyReportedsource, kind, coords, turfId
kartik-gangs:onVehicleStolensource, netId
kartik-gangs:onLaunderingFinishedsource, gangId, cleanAmount (fires after each laundering stop)

Rewards

EventArguments
kartik-gangs:onSpinWonsource, gangId, reward ({ kind, name, amount, label, rarity }), given (false if it's waiting to be claimed)
kartik-gangs:onLeaderboardFinishedperiod ('weekly' / 'monthly'), winners (list of { place, id, name, score, rewards })
kartik-gangs:onAirdropLootedsource, gangId (nil when a player without a gang opened it)

Contracts

EventArguments
kartik-gangs:externalContractStartedkey, source, runId, gangId (only for external contracts)
kartik-gangs:externalContractEndedkey, runId, status ('done', 'failed', 'expired'), reason

Wars

EventArguments
kartik-gangs:onWarFinishedwarId, winnerGangId (nil for a draw)

📤 Server events you can trigger

These work from server-side scripts only (not from clients). They do the same as the matching exports.

EventArgumentsSame as
kartik-gangs:addXpgangId, amount, reasonAddGangXp
kartik-gangs:addMoneygangId, account, amountAddGangMoney
kartik-gangs:removeMoneygangId, account, amountRemoveGangMoney
kartik-gangs:addStatgangId, key, amountAddGangStat
kartik-gangs:drugSoldsource, item, amount, priceDrugSold
TriggerEvent('kartik-gangs:addXp', gangId, 500, 'bank_heist')

🖥️ Client event

See onGangChanged.

On this page