Skip to content

Half-price superweapons

Every superweapon costs half and recharges twice as fast, including ones other mods add.

main.luau
for _, id in mod.data.list("superweapons") do
local w = mod.data.get("superweapons", id)
mod.data.patch("superweapons", id, {
price = math.max(1, w.price / 2), -- price is at least 1
cooldown = w.cooldown / 2,
})
end

price has a minimum of 1, so math.max keeps a cheap weapon valid. Mods that add weapons need to load before this one: add their ids to load_after.