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| Field | Description |
|---|---|
id | Gang ID |
name | Gang name |
color | Gang colour (hex) |
logo | Logo URL |
level | Gang level |
rank | The player's rank name |
priority | Rank position (1 = leader) |
isLeader | true if the player is the leader |
alias | The player's alias |
entrance | Hideout entrance coordinates |
IsInGang
Returns true if the local player is in a gang.
if exports['kartik-gangs']:IsInGang() then
-- gang-only feature
endHasPermission
Returns true if the local player's rank has a permission. See permission names.
if exports['kartik-gangs']:HasPermission('stash') then
-- allowed
endOpenTablet
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| Field | Description |
|---|---|
id | Turf ID |
label | Turf name |
ownerId | Owning gang ID, or nil |
ownerName | Owning gang name |
ownerColor | Owning 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| Field | Description |
|---|---|
id | Tag ID |
gangId | Gang that sprayed it |
text | Tag text |
coords | Tag position |
dist | Distance 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.