FluxWareScripting
Back to site

FluxWare Scripting

Write your own FluxWare modules in Lua. They appear in the module list next to the built-in ones, with their own settings, keybind and config.

What it is

A FluxWare script is Lua that declares a module. Once loaded it is a module in every sense the client understands: it sits in the list under the category its author gave it, takes a keybind, shows up in the ArrayList, and its settings are saved into and restored from your config alongside everything else.

Scripts come from the marketplace, and from nowhere else. You install one in the portal and it is in your game on the next sync. There is no scripts folder and no way to sideload, which is what makes the review every public script goes through a guarantee rather than a suggestion.

Writing one goes the same way: you create it in the portal and publish a private version, and your own scripts are always in your library. The getting started page walks through both.

An example

This is a complete, working script. It adds a module called Low Health Warning that flashes a border when you are hurt, with a threshold you can drag and a colour you can pick.

slug: low-health-warning
local m = module {
  name = 'Low Health Warning',
  category = 'render',
}

local threshold = m:setting('number', 'Threshold', 8, 1, 20)
local tint      = m:setting('color',  'Tint', 0x60FF3B30)

m:on('render2d', function()
  local hp = player.health()
  if not hp or hp > threshold:get() then return end

  local w, h = render2d.screenSize()
  render2d.outline(0, 0, w, h, 6, tint:get())
  render2d.text(string.format('%.1f HP', hp), 8, h - 20, 9, 0xFFFFFFFF)
end)

The shape of a script

Every script is the same three moves. Declare the module, declare its settings, register callbacks.

local m = module { name = 'My Module', category = 'misc' }

local enabled = m:setting('boolean', 'Do the thing', true)

m:on('tick', function()
  if enabled:get() then
    -- runs twenty times a second while the module is on
  end
end)

Callbacks only fire while the module is switched on, so there is no need to check whether you are enabled. The full list of events is on the events page, and everything a callback can reach is under Reference in the sidebar.

Scripts are budgeted
Callbacks run on the game thread, so a script that loops forever would freeze the client. Each callback gets a fixed allowance of work and is stopped if it exceeds it. You will see an error banner rather than a hang. The numbers are on the sandbox page.

Where to go next

If you have not written one yet, start with getting started: installing from the marketplace, the write-test loop for authoring, and what to do when something breaks.

If you are looking for something specific, the reference pages list every function with its exact signature. They are generated from the client itself, so they describe the version you are running rather than what the API looked like when somebody last wrote the page by hand.