Lux for Garry's Mod
Expressive Lux in. Ordinary GLua out.
Use one file for gradual GLua adoption, or build a full GMod project with packages, realm splitting, generated loaders, source maps, and a compiler-owned LSP.
single-file buildoptional autorun loaderregistryless packagescompiler LSP
import { arr } from "@lux/std"enum Badge repr number { Admin = 1, Alive = 2, Dead = 3,}fn badgeOf(ply) = ply?:IsAdmin() then Badge.Admin else ply?:Alive() then Badge.Alive else Badge.Deadfn tint(badge) = match badge { Badge.Admin => Color(255, 214, 92) Badge.Alive => Color(84, 236, 166) _ => Color(170, 178, 190) }client fn rows(players) = players |> arr.filter(%, (ply) => IsValid(ply)) |> arr.map(%, (ply) => { local badge = badgeOf(ply) { name = ply?:Nick() ?? "unknown", color = tint(badge) } })export client { scoreboardRows = rows }