⌘K

Custom Events (emit)

Updated 16 Mar 2026

Scripts can publish custom events that other scripts subscribe to.

Publishing

# In rewards.kode
set global $coins = $coins + 10
emit coins_updated

Subscribing

# In hud.kode
on coins_updated:
    send "&6Coins: $coins" to player

Any script with a matching on <eventName>: block will run when emit is called. This lets you decouple scripts from each other — rewards logic doesn't need to know anything about the HUD.