RedM documentation
Murphy's Craft
Advanced Usage
Exports and Events
Complete documentation of available exports and events to integrate murphy_craft with other scripts.
Table of Contents
Client Exports
Menu
OpenCraftMenu(categories?)
Opens the crafting menu.
CloseCraftMenu()
Closes the crafting menu.
OpenCraftStation(stationIndex)
Opens a crafting station by its config index.
Player Data
GetSpecialisationState()
Returns the complete state of player specialisations.
GetUnlockedRecipes()
Returns all unlocked recipes.
HasRecipeUnlocked(category, recipeId)
Checks if a recipe is unlocked.
GetSpecialisationXP(specialisationId)
Returns the player's XP for a specialisation.
GetSpecialisationPoints(specialisationId)
Returns available points.
GetSpecialisationTotalPoints(specialisationId)
Returns total earned points.
Utilities
GetNearbyCraftingCategories()
Returns accessible categories nearby.
GetNearbyCraftingStation(callback)
Checks if the player is near a station.
GetAllCraftCategories()
Returns all available crafting categories.
GetCategoryRecipes(category)
Returns recipes for a category.
RefreshSpecialisationData(callback?)
Reloads specialisation data from the server.
ClearCraftingData()
Clears crafting data (useful for character switching).
GetLocalSpecialisationProgress(specialisationId)
Returns local progression for a specialisation.
Server Exports
Player Data
GetPlayerCraftData(source)
Returns all crafting data for a player.
GetPlayerSpecialisationXP(source, specialisationId)
Returns a player's XP for a specialisation.
AddPlayerSpecialisationXP(source, specialisationId, amount)
Adds XP to a player.
SetPlayerSpecialisationXP(source, specialisationId, amount)
Sets a player's XP.
AddPlayerSpecialisationPoints(source, specialisationId, amount)
Adds specialisation points.
Recipes
HasPlayerRecipeUnlocked(source, category, recipeId)
Checks if a player has unlocked a recipe.
UnlockPlayerRecipe(source, category, recipeId)
Unlocks a recipe for a player.
LockPlayerRecipe(source, category, recipeId)
Locks a recipe for a player.
GetPlayerUnlockedRecipes(source, category)
Returns unlocked recipes for a category.
Stations
GetStationData(uniqueId)
Returns station data.
GetAllActiveStations()
Returns all active stations.
Utilities
ForceSaveCraftData()
Forces saving all data.
GetSpecialisations()
Returns specialisation configuration.
GetCraftCategories()
Returns crafting categories configuration.
ResetPlayerSpecialisation(source, specialisationId?)
Resets one or all player specialisations.
Specialisation & XP API
Server Events
These events allow manipulating specialisations from other server scripts.
murphy_craft:AddXP
Adds XP and automatically recalculates level.
murphy_craft:SetXP
Sets a specialisation's XP.
murphy_craft:AddPoints
Adds specialisation points.
murphy_craft:UnlockRecipe
Unlocks a recipe.
murphy_craft:LockRecipe
Locks a recipe.
murphy_craft:ResetSpecialisation
Resets a specialisation.
Specialisation Exports
GetPlayerSpecialisationLevel(source, specialisationId)
Returns current level (calculated from XP).
GetPlayerSpecialisationProgress(source, specialisationId)
Returns complete progression information.
GetPlayerAllSpecialisations(source)
Returns all specialisations with their progression.
IsPlayerMaxLevel(source, specialisationId)
Checks if the player has reached maximum level.
GetXPForLevel(specialisationId, level)
Returns XP required to reach a level.
GetMaxLevel(specialisationId)
Returns the maximum level for a specialisation.
Client Events (Listeners)
These events are triggered client-side to react to changes.
murphy_craft:OnXPGained
Triggered when the player gains XP.
murphy_craft:OnLevelUp
Triggered when the player levels up.
murphy_craft:OnXPSet
Triggered when XP is directly modified.
murphy_craft:OnPointsAdded
Triggered when points are added.
murphy_craft:OnRecipeUnlocked
Triggered when a recipe is unlocked.
murphy_craft:OnRecipeLocked
Triggered when a recipe is locked.
murphy_craft:OnSpecialisationReset
Triggered when a specialisation is reset.
murphy_craft:OnAllSpecialisationsReset
Triggered when all specialisations are reset.
Usage Examples
Give XP when player harvests
Check level before an action
Display progression in a menu
Quest reward with recipe unlock
Temporary XP bonus system
Important Notes
Thread Safety: Server exports are thread-safe and can be called from any thread.
Performance: Data is cached server-side. Exports do not make direct SQL queries.
Saving: Modifications are automatically saved according to
Config.SaveInterval. UseForceSaveCraftData()for immediate saving.Validation: The
murphy_craft:RequestAddXPAPI on client-side is server-validated (max 1000 XP per request) to prevent abuse.Synchronization: After modifying server data, the client automatically receives update events.
Last updated: January 19, 2026