A small demo plugin for Flux with one file of every kind a plugin is built from. Copy it to start a plugin of your own.
A plugin is a folder that Flux finds by convention: plugin.yml describes it, and the files
in plugin/ are included by their folder and realm prefix (cl_ client, sv_ server, sh_
both). Hooks are plain methods on the plugin's global table (function Skeleton:PlayerSpawn()),
and commands, roles, config definitions and phrases are one file each in the folder named
after their kind. Plugins live in flux-ce/plugins (framework plugins) or in
<schema>/plugins (schema plugins).
Clone the repository into a plugins folder under the name skeleton_plugin:
git clone https://github.com/TeslaCloud/flux-skeleton-plugin.git <schema>/plugins/skeleton_plugin
Every plugin in the schema's plugins folder loads by itself. When you clone it into
flux-ce/plugins/skeleton_plugin instead, add skeleton_plugin to the depends list of
your schema's <schema>.yml. The plugin only loads in the development environment; remove
the environment line of plugin.yml to run it elsewhere.
Players greet each other with /skeleton <target>, or by looking at a player and running the
skeleton_greet console command (bind g skeleton_greet). Each player counts the greetings
they have received, across sessions, and sees the count in the top right corner of the HUD.
Players are welcomed when they join unless the skeleton_greeting_enabled config is off.
plugin.yml: name, description, author and the environment the plugin loads in.plugin/sh_plugin.lua: the main file; sets theSkeletonglobal and includes the root files.plugin/lib/sh_skeleton.lua:Skeleton:get_greetings, the counter kept in the player data.plugin/lib/sv_skeleton.lua:Skeleton:greet, the checked entry point that runs thePlayerCanGreethook.plugin/cl_plugin.lua: theskeleton_greetconsole command, which sends thefl_skeleton_greetmessage.plugin/cl_hooks.lua: the HUD counter, translated only when the count or the language changes.plugin/sv_hooks.lua: the welcome notification when a player joins.plugin/nethooks/sv_skeleton.lua: the receiver offl_skeleton_greet, with validity, type, permission and rate checks.plugin/commands/sh_skeleton.lua: the/skeletoncommand.plugin/roles/sh_user.lua: grants theskeletonpermission to theuserrole and the roles based on it.plugin/config/config.yml: the definition of theskeleton_greeting_enabledconfig.plugin/languages/{en,es,fr,ru}.yml: every phrase the plugin shows, in four languages..proofreader.yml: the lint rules Flux code is checked against.
MIT, see LICENSE.