RedM documentation

Murphy's Craft

Crafting System

Job-Locked Crafting


This guide explains how to restrict access to craft categories and specific recipes based on player job and grade.

Table of Contents


Introduction

The job-locking system allows you to:

  • Restrict entire craft categories to specific jobs
  • Lock individual recipes within a category
  • Define a minimum grade required to access crafts

Relevant files: shared/craft/*.lua


Locking an Entire Category

To restrict an entire category to a specific job, add the job and jobgrade parameters at the category definition level.

Syntax

lua
Craft["category_name"] = {
name = "Display Name",
job = "job_name", -- Required job
jobgrade = 0, -- Minimum grade (optional)
recipes = {
-- All recipes here will be restricted to this job
}
}
lua
Craft["category_name"] = {
name = "Display Name",
job = {"job1", "job2", "job3"}, -- Required job
jobgrade = 0, -- Minimum grade (optional)
recipes = {
-- All recipes here will be restricted to this job
}
}

Parameters

Parameter Type Required Description
job string or table No Required job name (e.g., "doctor", "sheriff", "blacksmith")
jobgrade number No Minimum grade required (0 = any grade)

Example - Doctor Category

lua
Craft["medic_advanced"] = {
name = "Advanced Medicine",
job = "doctor", -- Only doctors can see this category
jobgrade = 2, -- Minimum grade 2 required
recipes = {
{
tree_ref = "root",
xp = 10,
name = "Surgery Kit",
freeaccess = true,
image = "nui://redemrp_inventory/html/items/kitchirurgie.png",
desc = "Advanced medical equipment",
duration = 10,
amount = 1,
item = "surgery_kit",
ressources = {
{ name = "Needle", neededQuantity = 2, item = "needle" },
{ name = "Thread", neededQuantity = 5, item = "thread" },
{ name = "Bandage", neededQuantity = 3, item = "bandage" },
}
},
}
}

Locking Specific Recipes

You can also lock individual recipes within a category that is accessible to everyone.

Syntax

lua
{
tree_ref = "root",
name = "Recipe Name",
job = "job_name", -- Required job for this recipe
jobgrade = 0, -- Minimum grade (optional)
freeaccess = true,
-- ... other parameters
}

Example - Mixed Recipes

lua
Craft["blacksmith"] = {
name = "Blacksmith",
-- No job/jobgrade here = category accessible to all
recipes = {
-- Recipe accessible to everyone
{
tree_ref = "root",
xp = 5,
name = "Horseshoe",
freeaccess = true,
image = "nui://redemrp_inventory/html/items/horseshoe.png",
desc = "For shoeing horses",
duration = 8,
amount = 1,
item = "horseshoe",
ressources = {
{ name = "Iron Ingot", neededQuantity = 2, item = "iron_ingot" },
}
},
-- Recipe reserved for blacksmiths
{
tree_ref = "node1",
xp = 20,
name = "Quality Sword",
job = "blacksmith", -- Only blacksmiths can see this recipe
jobgrade = 1, -- Minimum grade 1
freeaccess = true,
image = "nui://redemrp_inventory/html/items/sword.png",
desc = "A superior quality sword",
duration = 30,
amount = 1,
item = "quality_sword",
ressources = {
{ name = "Steel Ingot", neededQuantity = 5, item = "steel_ingot" },
{ name = "Leather", neededQuantity = 2, item = "leather" },
}
},
-- Recipe reserved for sheriffs
{
tree_ref = "node2",
xp = 15,
name = "Handcuffs",
job = "sheriff", -- Only sheriffs can see this recipe
freeaccess = true,
image = "nui://redemrp_inventory/html/items/handcuffs.png",
desc = "For arresting outlaws",
duration = 15,
amount = 1,
item = "handcuffs",
ressources = {
{ name = "Iron Ingot", neededQuantity = 3, item = "iron_ingot" },
}
},
}
}

System Behavior

Priority Rules

  1. No job specified → Accessible to all players
  2. job specified without jobgrade → Any grade of that job can access
  3. job and jobgrade specified → Player must have the job AND grade ≥ required grade
  4. Recipe with job → Overrides category restrictions for that recipe

Category Visibility

  • A category is hidden if the player doesn't meet access requirements
  • A category is also hidden if it contains no accessible recipes for the player

Summary Table

Category job Recipe job Result
Not defined Not defined Accessible to all
"doctor" Not defined Accessible to doctors only
Not defined "doctor" Recipe accessible to doctors only
"doctor" "sheriff" Recipe accessible to sheriffs (override)

Complete Examples

Example 1: Exclusive Doctor Category

lua
-- File: shared/craft/medic.lua
Craft["medic"] = {
name = "Medicine",
job = "doctor",
recipes = {
{
tree_ref = "root",
xp = 5,
name = "Bandage",
freeaccess = true,
image = "nui://redemrp_inventory/html/items/bandage.png",
desc = "Heals minor wounds",
duration = 5,
amount = 2,
item = "bandage",
ressources = {
{ name = "Cotton", neededQuantity = 3, item = "cotton" },
}
},
{
tree_ref = "node1",
xp = 15,
name = "Morphine",
jobgrade = 3, -- Grade 3+ required (in addition to being a doctor)
freeaccess = true,
image = "nui://redemrp_inventory/html/items/morphine.png",
desc = "Powerful painkiller",
duration = 10,
amount = 1,
item = "morphine",
ressources = {
{ name = "Poppy", neededQuantity = 5, item = "poppy" },
{ name = "Alcohol", neededQuantity = 2, item = "alcohol" },
}
},
}
}

Example 2: Public Category with Restricted Recipes

lua
-- File: shared/craft/cooking.lua
Craft["cooking"] = {
name = "Cooking",
-- No restriction at category level
recipes = {
-- Accessible to everyone
{
tree_ref = "root",
xp = 2,
name = "Bread",
freeaccess = true,
image = "nui://redemrp_inventory/html/items/bread.png",
desc = "Fresh baked bread",
duration = 5,
amount = 1,
item = "bread",
ressources = {
{ name = "Flour", neededQuantity = 2, item = "flour" },
{ name = "Water", neededQuantity = 1, item = "water" },
}
},
-- Reserved for professional cooks
{
tree_ref = "node1",
xp = 20,
name = "Royal Feast",
job = "cook",
jobgrade = 2,
freeaccess = true,
image = "nui://redemrp_inventory/html/items/feast.png",
desc = "A meal fit for a king",
duration = 30,
amount = 1,
item = "royal_feast",
ressources = {
{ name = "Meat", neededQuantity = 5, item = "meat" },
{ name = "Vegetables", neededQuantity = 3, item = "vegetables" },
{ name = "Spices", neededQuantity = 2, item = "spices" },
}
},
}
}

Important Notes

Warning: Job names (job) must exactly match the names used in your framework (VORP, RSG-Core, REDEMRP).

Tip: Test your configurations with Config.Debug = true in shared/config.lua to see filtering logs.

Reminder: The freeaccess = true parameter allows access to the recipe without specialization progression. It is independent of the job-locking system.


Last updated: September 9, 2026