Exports
Export list including compatibility exports
mz-skills
Compatibly
mz-skills
CompatiblyWill work without changing xp system in other script configs from mz-skills by default Example exports used in this section can use mz-skills or ss-knowledge for the resource name in the export.
Update Skill
exports['ss_knowledge']:UpdateSkill(branch, xp)
Parameters:
branch (name of branch in config. i.e. lockpicking)
XP (amount of xp)
Example
exports['ss_knowledge']:UpdateSkill(robbing, 17) -- adds xp
exports['ss_knowledge']:UpdateSkill(robbing, -10)
-- removes xp (not done well in mz-skills by default)
Check Skill
exports['ss_knowledge']:CheckSkill(branch, xp)
Parameters:
branch (name of branch in config. i.e. lockpicking)
XP (amount of xp)
Returns:
True or False
Example
local result = exports['ss_knowledge']:CheckSkill(branch, xp)
print(result) --will print boolean of true or false
Get Current Skill
exports['ss_knowledge']:GetCurrentSkill(branch)
Parameters:
branch (name of branch in config table. i.e. lockpicking)
Returns:
Table of contents - [name, min xp, max xp, current]
example
local result = exports['ss_knowledge']:GetCurrentSkill(hacking)
print(result) --will print table of contents - [Name,Min,Max,Current]
-- Name = branch name
-- Min = Min xp
-- Max = Max xp
-- Current = Current xp
Script Exports
Get Knowledge Branch
exports['ss_knowledge']:GetKnowledgeBranch(xp, branch)
Parameters:
XP (amount of xp)
branch (name of branch in config. i.e. lockpicking)
Returns:
Level number or title ( defaults to number only if level has no name in the config)
Full level info (title, minxp, maxxp)
Has checks for the branch being missing in the config.
Example
local title, branchInfo = exports['ss_knowledge']:GetKnowledgeBranch(300, bus)
print(title) -- Prints "Crude"
print(json.encode(branchInfo)) --prints(Crude, 201, 400) (title,minxp, maxxp)
Get Current Knowledge Branch
exports['ss_knowledge']:GetCurrentKnowledgeBranch(branch)
Parameters:
branch (name of branch in config. i.e. lockpicking)
Returns:
Level number or title ( defaults to number only if level has no name in the config)
Full level info (title, minxp, maxxp)
Example
local title, branchInfo = exports['ss_knowledge']:GetCurrentKnowledgeBranch(bus)
print(title) -- Prints "Crude"
print(json.encode(branchInfo)) --prints(Crude, 201, 400) (title,minxp maxxp)
Get Branch Tier
exports['ss_knowledge']:GetBranchTier(xp, branch)
Parameters:
XP (amount of xp)
branch (name of branch in config. i.e. lockpicking)
Returns:
Level number
Example
local result = exports['ss_knowledge']:GetBranchTier(300, bus)
print(result) -- Prints "2"
Update Knowledge Branch
exports['ss_knowledge']:UpdateKnowledgeBranch(branch, xp)
Parameters:
branch (name of branch in config. i.e. lockpicking)
XP (amount of xp to be added or removed)
As this is used for updating the branches xp there is no return result.
Example
local title, branchInfo = exports['ss_knowledge']:UpdateKnowledgeBranch(bus, 300)
Check Knowledge Branch
exports['ss_knowledge']:CheckKnowledgeBranch(branch, xp)
Parameters:
branch (name of branch in config. i.e. lockpicking)
XP (amount to check against)
Returns:
Boolean (True or False)
Example
local title, branchInfo = exports['ss_knowledge']:CheckKnowledgeBranch(bus, 300)
print(title) -- Prints "true"
Check Knowledge Tier
exports['ss-knowledge']:CheckKnowledgeTier(branch, level)
Parameters:
branch (name of branch in config. i.e. lockpicking)
level (level to check against)
Returns:
Boolean (True or False)
Example
local result = exports['ss_knowledge']:CheckKnowledgeTier(bus, 3)
print(result) -- Prints "true"
Last updated