rlDevelopment
  • ๐Ÿ‘‹Introduction
  • ๐ŸงพResources
    • โ•rl_requirements
      • ๐Ÿ“œExports
    • ๐Ÿƒโ€โ™‚๏ธrl_skills
      • ๐Ÿ’ปClient Exports
      • ๐Ÿ’ปServer Exports
Powered by GitBook
On this page
  • exports["rl_skills"]:GetSkillData(Source, "driving")
  • exports["rl_skills"]:AddXP(Source, SkillName, XPAmount)
  • exports["rl_skills"]:RemoveXP(Source, SkillName, XPAmount)
  1. Resources
  2. rl_skills

Server Exports

Here u will find some useful server export examples

exports["rl_skills"]:GetSkillData(Source, "driving")

Required values:

These values are examples, adapt them to what you need!

  • Source (PlayerID)

  • SkillName ("driving")

This will return the skill data for given skill.

// Example Usage
local Source = source
local SkillData = exports["rl_skills"]:GetSkillData(Source, "driving)
if SkillData == nil then
   return false, lib.notify(Source, { 
        title = "Skills", 
        description = "Your skilldata has not been found, try again",
        duration = 2500,
        position = "bottom",
        type = "error", 
        style = {
            backgroundColor = "#131121",
            color = "#ffffff"
        },
    })
end

This exports will return a table of values, below you will find the values that will get returned.

local SkillData = exports["rl_skills"]:GetSkillData(Source, "driving)
print(SkillData.Name, SkillData.XP, SkillData.XPAfter, SkillData.Level, SkillData.ReqXP)

exports["rl_skills"]:AddXP(Source, SkillName, XPAmount)

Required values:

These values are examples, adapt them to what you need!

  • Source (PlayerID)

  • SkillName ("driving")

  • XPAmount (10)

// Example Usage
exports["rl_skills"]:AddXP(Source, 
    "driving", 
    math.random(10, 20)
)

// Example Usage
exports["rl_skills"]:AddXP(Source, 
    "driving", 
    10
)

exports["rl_skills"]:RemoveXP(Source, SkillName, XPAmount)

Required values:

These values are examples, adapt them to what you need!

  • Source (PlayerID)

  • SkillName ("driving")

  • XPAmount (10)

// Example Usage
exports["rl_skills"]:RemoveXP(Source, 
    "driving", 
    math.random(10, 20)
)

// Example Usage
exports["rl_skills"]:RemoveXP(Source, 
    "driving", 
    10
)
PreviousClient Exports

Last updated 1 year ago

๐Ÿงพ
๐Ÿƒโ€โ™‚๏ธ
๐Ÿ’ป