Skip to content

๐Ÿงฎ FX-CRAFT โ€‹

Advanced crafting system for RedM with XP, level system, prop crafting, and full framework compatibility.


๐Ÿ“ฆ INSTALLATION โ€‹

bash
ensure fx-craft

โ€ข Place the script inside resources/fx-craft โ€ข Add ensure fx-craft to your server.cfg โ€ข Restart your server


โš™๏ธ DEPENDENCIES โ€‹

lua
dependencies {
    'oxmysql'
}

โ€ข Required for database operations
โ€ข Script will not work without it
โ€ข You can use tools like HeidiSQL or phpMyAdmin to manage your database
โ€ข Make sure oxmysql is started before fx-craft


๐Ÿ—„๏ธ SQL INSTALLATION โ€‹

๐Ÿ“Œ CRAFT TABLES โ€‹

sql
CREATE TABLE IF NOT EXISTS `fx_craft_book` (
    `bookId` VARCHAR(50) PRIMARY KEY,
    `bookName` VARCHAR(100),
    `allowedJobs` TEXT NOT NULL,
    `createdAt` VARCHAR(20) DEFAULT NULL,
    `craftData` LONGTEXT NOT NULL DEFAULT '[]'
);

CREATE TABLE IF NOT EXISTS `fx_craft_player` (
    `charid` VARCHAR(50) NOT NULL,
    `job` VARCHAR(50) NOT NULL,
    `totalProduction` INT DEFAULT 0,
    `currentXP` INT DEFAULT 1,
    `currentLevel` INT DEFAULT 1,
    PRIMARY KEY (`charid`, `job`)
);

โ€ข Stores player crafting progress and XP โ€ข Handles crafting queue and production data โ€ข Required for level system


๐Ÿ“ฆ VORP ITEM INSTALL โ€‹

sql
REPLACE INTO `items` (`item`, `label`, `limit`, `can_remove`, `type`, `usable`, `metadata`, `desc`)
VALUES
('craftbook', 'Craft Book', 5, 1, 'item_standard', 1, '{}', 'a craft book with recipes for making crafts'),
('p_benchwork01x', 'Craft Table', 5, 1, 'item_standard', 1, '{}', 'A workbench for Making Craft'),
('ironhammer', 'Hammer', 5, 1, 'item_standard', 1, '{}', 'A tool often used for crafting');

โ€ข Required items for crafting system โ€ข craftbook โ†’ opens crafting UI โ€ข p_benchwork01x โ†’ spawns crafting table โ€ข ironhammer โ†’ required tool item


๐Ÿ“ฆ RSG ITEM INSTALL โ€‹

lua
craftbook = {
    name = 'craftbook',
    label = 'Craft Book',
    weight = 100,
    type = 'item',
    image = 'craftbook.png',
    unique = true,
    useable = true,
    shouldClose = true,
}

โ€ข Required if using RSG inventory โ€ข useable = true is mandatory


โš™๏ธ CONFIG SYSTEM โ€‹

๐Ÿ”ง BASIC CONFIG โ€‹

lua
Config.Language = "en"
Config.OrderListLimit = 10
Config.CraftSecurity = true
Config.HideLockedItems = true

โ€ข Language โ†’ system language โ€ข OrderListLimit โ†’ max active crafting queue โ€ข CraftSecurity โ†’ prevents NUI exploit manipulation โ€ข HideLockedItems โ†’ hides items that player cannot craft


๐Ÿ“Š LEVEL SYSTEM โ€‹

lua
Config.Levels = {
  [1] = 1000,
  [2] = 2000,
}

โ€ข Defines XP required per level โ€ข Higher levels unlock more recipes


๐Ÿงฑ PROP SYSTEM โ€‹

lua
Config.SpawnPropItems = {
  ["p_benchwork01x"] = {
    propModel = "p_benchwork01x",
    durabilityDay = 3,
    requiredItems = {
      ["ironhammer"] = {count = 1, remove = false},
      ["wood"] = {count = 5, remove = true},
    },
    craftData = Craft.CraftItems
  },
}

โ€ข Allows players to spawn crafting tables โ€ข requiredItems โ†’ materials needed to place table โ€ข durabilityDay โ†’ lifetime of the prop โ€ข craftData โ†’ defines available recipes


๐Ÿ“˜ OPEN CRAFT BOOK โ€‹

lua
TriggerServerEvent("fx-craft:server:OpenBook", Jobs, CraftData, bookImage, bookName, bookId)

โ€ข Opens crafting UI โ€ข Jobs = false โ†’ accessible to all players โ€ข CraftData โ†’ recipe categories โ€ข bookId โ†’ must be unique


๐Ÿ“š WORLD CRAFT BOOK โ€‹

lua
Config.CraftBooks = {
  ["valgunsmith"] = {
    bookID = "FX-1001",
    Settings = {
      coords = {
        vector4(-277.22, 779.18, 119.50, 267.68)
      },
    },
    Categories = Craft.GunItems,
  },
}

โ€ข Creates crafting interaction points in the world โ€ข Players interact via prompt โ€ข Categories โ†’ determines available recipes โ€ข coords โ†’ location of interaction


๐Ÿง  RECIPE SYSTEM โ€‹

lua
Recipes["weapon_melee_knife"] = {
    itemName = "weapon_melee_knife",
    rewardXP = 50,
    duration = 30,
    requiredLevel = 1,
    requiredItems = RequiredItems["melee"]
}

โ€ข Defines craftable items โ€ข rewardXP โ†’ XP gained โ€ข duration โ†’ crafting time โ€ข requiredItems โ†’ required materials


๐Ÿ”จ REQUIRED ITEMS โ€‹

lua
RequiredItems["melee"] = {
    {itemName = "ironbar", itemCount = 1},
}

โ€ข Defines crafting materials โ€ข itemCount โ†’ required quantity โ€ข dontremove โ†’ optional (prevents item removal)


๐ŸŽญ ANIMATION SYSTEM โ€‹

lua
CraftAnims["table"]

โ€ข Controls player animation during crafting โ€ข Improves immersion


๐Ÿ—‚๏ธ CATEGORY SYSTEM โ€‹

lua
Craft.CraftItems = {
  ["materials"] = {
    label = "Materials",
    items = { ... }
  }
}

โ€ข Defines UI categories (tabs) โ€ข items โ†’ list of recipes


๐Ÿ”” NOTIFY SYSTEM โ€‹

lua
Notify({
  text = "Craft Started",
  type = "success"
})

โ€ข Sends notifications based on framework โ€ข Supports VORP / RSG / REDEMRP โ€ข type โ†’ success / error / info


โš™๏ธ SERVER CONFIG โ€‹

lua
SV_Config.Webhook = {
    url = "",
    logo = "",
    banner = "",
}

โ€ข Used for logging and webhook integrations โ€ข Optional but recommended


โš ๏ธ IMPORTANT NOTES โ€‹

โ€ข bookId must always be unique โ€ข requiredItems must match recipe keys โ€ข CraftSecurity should stay enabled โ€ข Categories must exist โ€ข oxmysql must be running


๐Ÿšจ COMMON MISTAKES โ€‹

โ€ข Duplicate bookId โ€ข Missing RequiredItems โ€ข Wrong category reference โ€ข Invalid CraftData โ€ข Missing SQL tables


๐Ÿ SUMMARY โ€‹

FX-Craft provides:

โ€ข Advanced crafting system โ€ข XP & level progression โ€ข World + prop crafting โ€ข Framework compatibility โ€ข Secure crafting validation


ยฉ Fixitfy Development

โšก Premium RedM scripts crafted with performance & quality in mind.