๐งฎ FX-CRAFT โ
Advanced crafting system for RedM with XP, level system, prop crafting, and full framework compatibility.
๐ฆ INSTALLATION โ
ensure fx-craftโข Place the script inside resources/fx-craft โข Add ensure fx-craft to your server.cfg โข Restart your server
โ๏ธ DEPENDENCIES โ
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 โ
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 โ
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 โ
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 โ
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 โ
Config.Levels = {
[1] = 1000,
[2] = 2000,
}โข Defines XP required per level โข Higher levels unlock more recipes
๐งฑ PROP SYSTEM โ
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 โ
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 โ
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 โ
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 โ
RequiredItems["melee"] = {
{itemName = "ironbar", itemCount = 1},
}โข Defines crafting materials โข itemCount โ required quantity โข dontremove โ optional (prevents item removal)
๐ญ ANIMATION SYSTEM โ
CraftAnims["table"]โข Controls player animation during crafting โข Improves immersion
๐๏ธ CATEGORY SYSTEM โ
Craft.CraftItems = {
["materials"] = {
label = "Materials",
items = { ... }
}
}โข Defines UI categories (tabs) โข items โ list of recipes
๐ NOTIFY SYSTEM โ
Notify({
text = "Craft Started",
type = "success"
})โข Sends notifications based on framework โข Supports VORP / RSG / REDEMRP โข type โ success / error / info
โ๏ธ SERVER CONFIG โ
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
