
Events
EventBus Kit
scriptgo//event-bus
Typed topics with schema validation, retained values, rate limits and opt-in client delivery.
Runs on · 1.0.2
Godot 4
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
LÖVE
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
Luanti
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
Neovim
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
OPEN//77
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
Standalone Lua
VerifiedPassed in the real runtime (scriptgo verify).
- Release
- 1.0.2
- Tested
CC: Tweaked (Minecraft)
FailingThe last run failed.
- Release
- 1.0.2
- Tested
EventBus Kit
Typed topics on top of the host event bus. A resource declares a topic once, with a schema, and any resource can then publish to it. Payloads that break the schema are refused with the path of the bad field, so a typo in one resource cannot corrupt the state of another.
- Schemas for every payload: strings, numbers, booleans, tables, arrays, with bounds, patterns and enums.
- Retained values: late subscribers read the last payload with
last(topic). - Client delivery for topics marked
public, and client publishing for topics markedclientPublish, validated by the server and rate limited per player. - Ownership: a topic belongs to the resource that defined it and disappears when that resource stops.
Install
scriptgo add scriptgo//event-bus-- scriptgo.lua of your resource
dependency "sg_eventbus >=1.0.0"Example
A shop announces sales on a typed topic. This block is the README example that scriptgo verify
runs next to the package in every environment, so its output is in each compatibility run.
local bus = exports.sg_eventbus
AddEventHandler("sgbus:shop.sale", function(sale, meta)
print(("sale #%d from %s: %s for %d"):format(meta.seq, meta.publisher, sale.item, sale.price))
end)
-- Exports are called from a thread or a handler, never at file scope (OPEN//77 refuses that
-- with resource_preparing, and so does every SCRIPT//GO host).
CreateThread(function()
-- Payloads on "shop.sale" must have this shape. The last sale is kept (retain).
print(bus:defineTopic("shop.sale", {
schema = { type = "table", fields = {
item = { type = "string", maxLength = 32 },
price = { type = "number", min = 0 },
} },
retain = true,
}))
print(bus:publish("shop.sale", { item = "water", price = 3 })) -- true 1
print(bus:publish("shop.sale", { item = "water", price = "free" })) -- false invalid_payload: ...
local last = bus:last("shop.sale")
print("last sale: " .. last.item)
end)Server API
Call these through exports.sg_eventbus:<name>(...).
| Export | Returns |
|---|---|
defineTopic(name, opts) |
true, or false, reason |
publish(name, payload) |
true, seq, or false, reason |
last(name) |
payload, meta of the last retained publication |
topics() |
list of { name, owner, retain, public, clientPublish, seq } |
stats() |
{ topics, published, rejected } |
opts of defineTopic:
| Field | Default | Meaning |
|---|---|---|
schema |
none | shape every payload must match |
retain |
false |
keep the last payload for last() and for clients that sync |
public |
false |
also send each publication to every client |
clientPublish |
false |
accept publications from clients |
ratePerSecond |
20 |
publications per second per publisher |
Subscribers listen with AddEventHandler("sgbus:<topic>", function(payload, meta) ... end).
meta is { topic, seq, publisher, player, at }: publisher is the resource that published
("client" for a publication from a client), player the player id in that case.
Reasons a publication is refused: unknown_topic, client_publish_forbidden, rate_limited,
invalid_payload: <path>: <what>. defineTopic refuses with invalid_topic_name,
invalid_schema or topic_owned_by:<resource> (another resource defined it first). last
answers nil, "unknown_topic" or nil, "not_retained".
Schemas
| Type | Options |
|---|---|
string |
maxLength, pattern, enum, optional |
number |
min, max, integer, optional |
boolean |
optional |
table |
fields, additional (allow unknown fields, default true), optional |
array |
items, maxItems, optional |
any |
anything |
Client API
| Export | Returns |
|---|---|
publish(name, payload) |
sends it to the server, which validates it (needs clientPublish) |
last(name) |
payload, meta of a public retained topic, after the initial sync |
track(name) |
keeps last(name) current for a public retained topic |
rejections() |
the last refusals the server sent back |
Clients receive public publications as the network event sgbus:<topic>.
Environments
Server side everywhere the kit is verified. Client delivery needs a host with clients and networking (OPEN//77, Luanti players, the simulated players of the standalone host). The compatibility runs on the package page show what ran where.
License
MIT.
With the CLI
scriptgo add scriptgo//event-busManual download
Zip of 1.0.2 · 8.3 KiB. Check the SHA-256 before unpacking.
Download sg_eventbus-1.0.2.zipsha256 c73f6be7c6edb8deeb447c2132c2edb7c462aa01318b2b762da00361fac02cd5
Set it up
| Environment | Status | Tested | Details |
|---|---|---|---|
| Godot 4 | Verified | Godot 4 VerifiedPassed in the real runtime (scriptgo verify).
| |
| LÖVE | Verified | LÖVE VerifiedPassed in the real runtime (scriptgo verify).
| |
| Luanti | Verified | Luanti VerifiedPassed in the real runtime (scriptgo verify).
| |
| Neovim | Verified | Neovim VerifiedPassed in the real runtime (scriptgo verify).
| |
| OPEN//77 | Verified | OPEN//77 VerifiedPassed in the real runtime (scriptgo verify).
| |
| Standalone Lua | Verified | Standalone Lua VerifiedPassed in the real runtime (scriptgo verify).
| |
| CC: Tweaked (Minecraft) | Failing | CC: Tweaked (Minecraft) FailingThe last run failed.
|
This release
- Signature
- ed25519, registry key 95f9 01ba 64d0 898a · signed 10 Nov 2026It covers the package, the version and the SHA-256 of the file you download.
scriptgo addrefuses a file that does not match.
What your server gets, per environment
| Environment | Tier there | For this release |
|---|---|---|
| Lua Standalone | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| LÖVE | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| Godot 4 | Licence + signingPlanned, not available yet. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| Luanti | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| OPEN//77 | Code escrowAvailable as an opt-in server feature. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| Neovim | Licence + signingAvailable today. | Free package. No licence is needed. The registry's signature shows the release was not altered. |
| CC: Tweaked (Minecraft) | No licence check | No licence check. The adapter there has no licence check, so nothing verifies a licence at run time. The release is signed, so you can check it was not altered. |
The platforms’ own rules
For information: whoever runs a script there answers for the platform's own rules.
- OPEN//77: A script is your own code. CD PROJEKT RED's own rules cover the game's content.
- CC: Tweaked (Minecraft): The Minecraft EULA lets you do what you want with your mods "as long as you don't sell them for money" (minecraft.net/en-us/eula).
Deterrence, traceability and revocation: only server scripts are protected, and a copy stays traceable. What protection does and does not do
sha256 c73f6be7c6edb8deeb447c2132c2edb7c462aa01318b2b762da00361fac02cd5
- Declares Neovim: verified inside Neovim 0.12 through the SCRIPT//GO plugin.
- Code license
- MIT
No offers. Use the package under its code license (MIT).
Sold by SCRIPT//GO. No payment provider connected. License issued by SCRIPT//GO.
A license is granted only on a verified payment event.Who does what
- Declared
- 10 Nov 2026
- Ownership
- The creator states they own this code or are authorized to distribute it.
- Third-party game
- Does not target or include proprietary third-party game content.
Third-party assets
No third-party assets declared.
Dependencies
No dependencies.
Think this package infringes your rights? Report it. No account needed.
Data from the SCRIPT//GO API. Only recorded runs count.

