Editable
Editable
Note: This documentation describes the functions in the
editablefolders. You are free to modify, extend, or adapt to fit your server's needs.
Client Side (client/editable/)
client/editable/)1. keyBinds.lua
keyBinds.luaKey Hints System
showKeyHints(type, subType)
Displays key hints for the current action.
Arguments:
type(string): Main mode (e.g., "mining_ore").subType(string, optional): Sub-mode for more specific hints.
Usage: Shows hints using the
5s_keyhints_survivalresource.
hideKeyHints()
Hides all currently displayed key hints.
Keybinds
mining
Default Key:
MOUSE_LEFTDescription: Triggers the mining action (calls
keybindHit()).
2. events.lua
events.luaisDead()
Checks if the player's character is dead.
Returns:
trueif dead, otherwisefalse.
3. weapons.lua
weapons.luagetCurrentWeapon()
Gets the name of the currently equipped weapon using
ox_inventoryexport.Returns: Weapon name (
string) ornilif none.
Server Side (server/editable/)
server/editable/)1. inventory.lua
inventory.luacanCarryItem(source, itemName, count)
Checks if a player can carry a certain amount of an item.
Arguments:
source(number): Player's server ID.itemName(string): Name of the item.count(number): Amount to check.
Returns:
trueif the player can carry, otherwisefalse.
addItem(source, itemName, count)
Adds an item to the player's inventory.
Arguments:
source(number): Player's server ID.itemName(string): Name of the item.count(number): Amount to add.
createDrop(source, itemName, count)
Creates a custom item drop at the player's location if inventory is full.
Arguments:
source(number): Player's server ID.itemName(string): Name of the item.count(number): Amount to drop.
2. validation.lua
validation.luacanMine(src, ore)
Checks if a player can mine a specific ore.
Arguments:
src(number): Player's server ID.ore(string): Name of the ore to mine.
Returns:
trueif the player can mine, otherwisefalse.Usage: You can add custom validation (e.g., level checks, tool requirements, location restrictions).
checkDamage(src, ore, weapon, baseDamageForOre)
Calculates the damage dealt by a player during mining.
Arguments:
src(number): Player's server ID.ore(string): Name of the ore being mined.weapon(string): Name of the weapon/tool being used.baseDamageForOre(number): Base damage value for the ore.
Returns: Modified damage value (number).
Usage: You can customize damage based on weapon type, player level, or other factors.
onHit(source, weapon, ore)
Called when a player hits an ore with a weapon.
Arguments:
source(number): Player's server ID.weapon(string): Name of the weapon/tool being used.ore(string): Name of the ore being mined.
Usage: You can decrease weapon durability here.
All files in the
editablefolders are intended for easy customization without affecting the core logic. For further customization, refer to the comments and structure in each file.
Last updated