Create custom Expression2 extensions
masterYou can extend Expression2 by placing custom Lua files in the lua/entities/gmod_wire_expression2/core/custom/ directory. These files are automatically loaded by the system at runtime.
To support both server-side logic and client-side rendering/functionality, use a dual-file naming convention:
- Server-side logic: Create a file with the base name (e.g.,
filename.lua). This file is loaded on the server. - Client-side logic: Create a file prefixed with
cl_using the same base name (e.g.,cl_filename.lua). This file is automatically transferred to and loaded on the client.
Example File Structure:
foo.lua(Loaded on the server)cl_foo.lua(Transferred to and loaded on the client)
# Example for an extension named 'foo'
foo.lua -> Server-side
cl_foo.lua -> Client-side