🎮FiveM Lua Lib
A comprehensive Lua library for FiveM development that provides utilities, helpers, and common patterns to streamline server and client-side scripting.
🤔 What is FiveM Lua Lib?
FiveM Lua Lib is a collection of reusable Lua functions, classes, and utilities designed specifically for FiveM development. It aims to reduce boilerplate code and provide common functionality that developers frequently need whe`n building FiveM resources.
🎯 Purpose
⚡ Simplify Development: Reduce repetitive code and provide ready-to-use functions
📋 Standardize Patterns: Establish consistent coding patterns across your FiveM projects
🔧 Improve Maintainability: Well-tested utilities that you can rely on
🚀 Speed Up Development: Focus on your game logic instead of reinventing common functionality
✨ Key Features
👥 Player Management: Utilities for handling player data, permissions, and interactions
🚗 Vehicle System: Helpers for vehicle spawning, management, and customization
📡 Event System: Simplified event handling and communication
🛠️ Utility Functions: String manipulation, math helpers, and other common utilities
🏗️ Class System: Object-oriented programming support for complex systems
🚀 Installation
The jd-library is now its own script. Here's how to install it:
Download from GitHub
Add the folder to your
resourcesdirectory of your FXServerEnsure
jd-libraryin yourserver.cfgbefore other resources that use it:ensure jd-library ensure your-script-nameAdd
"@jd-library/init.lua"toclient_scriptsorserver_scriptsin thefxmanifest.luafile of any script that uses jd-library:-- For client usage client_script '@jd-library/init.lua' -- For server usage server_script "@jd-library/init.lua"
🚀 Quick Start
Once installed, you can use the library in your scripts:
-- Events
events:on('playerSpawned', function()
print('Player spawned!')
end)
-- Players
players:setHp(200)
players:tp({x = 100, y = 200, z = 30})
-- Vehicles
local vehicle = vehicles:spawn('adder', players:pos())
-- Utils
utils:print('Health: {1}', players:hp())Created by @jax.danger
Last updated