Kartik Scripts

Client Exports

GetMyGang

Returns the local player's gang, or nil if they aren't in one.

local gang = exports['kartik-gangs']:GetMyGang()
if gang then
    print(gang.name, gang.rank, gang.level)
end
FieldDescription
idGang ID
nameGang name
colorGang colour (hex)
logoLogo URL
levelGang level
rankThe player's rank name
priorityRank position (1 = leader)
isLeadertrue if the player is the leader
aliasThe player's alias
entranceHideout entrance coordinates

IsInGang

Returns true if the local player is in a gang.

if exports['kartik-gangs']:IsInGang() then
    -- gang-only feature
end

HasPermission

Returns true if the local player's rank has a permission. See permission names.

if exports['kartik-gangs']:HasPermission('stash') then
    -- allowed
end

OpenTablet

Opens the Gang Tablet.

exports['kartik-gangs']:OpenTablet()

OpenGangRegistration

Opens the gang registration form, or the player's waiting request if they already sent one. Players who are already in a gang just get a message.

exports['kartik-gangs']:OpenGangRegistration()

GetCurrentTurf

Returns the turf the player is standing in, or nil.

local turf = exports['kartik-gangs']:GetCurrentTurf()
if turf then
    print(turf.label, turf.ownerName)
end
FieldDescription
idTurf ID
labelTurf name
ownerIdOwning gang ID, or nil
ownerNameOwning gang name
ownerColorOwning gang colour

IsRestrained

Returns true if the local player is tied up.

local tied = exports['kartik-gangs']:IsRestrained()

IsBagged

Returns true if the local player has a head bag on.

local bagged = exports['kartik-gangs']:IsBagged()

IsInsideHideout

Returns true if the local player is inside a hideout.

local inside = exports['kartik-gangs']:IsInsideHideout()

openDesk

Opens the management desk.

exports['kartik-gangs']:openDesk()

GraffitiNearest

Returns the closest graffiti tag within a distance (default 3 metres), or nil.

local tag = exports['kartik-gangs']:GraffitiNearest(5.0)
if tag then
    print(tag.text, tag.gangId, tag.dist)
end
FieldDescription
idTag ID
gangIdGang that sprayed it
textTag text
coordsTag position
distDistance from the player

Client Event: onGangChanged

Fires on the player's own client when they join, leave or change rank.

AddEventHandler('kartik-gangs:onGangChanged', function(gang, previousGangId)
    if gang then
        print('Now in', gang.name, 'as', gang.rank)
    else
        print('Left the gang')
    end
end)

gang is false when the player is no longer in a gang.

On this page