Fixed lakitushop + Code to override the coin counter

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

Marioman2007
2025 Egg Hunter
2025 Egg Hunter
Posts: 537
Joined: Tue Aug 25, 2020 3:19 am
Flair: Dr. Bones
Pronouns: He/Him

Fixed lakitushop + Code to override the coin counter

Postby Marioman2007 » Sat Feb 15, 2025 3:11 am

Heya
This is a version of the basegame lakitushop which fixes its errors, and also adds a way to define its items in the editor.

Spoiler: show
Image

And here's some code to make a custom custom coin counter which overrides the default one.
(Put it in your luna.lua file)

Code: Select all

-- make the shop use currencies
local lakitushop = require("custom_lakitushop")
lakitushop.defaultConfig.useCurrencies = true

local hudoverride = require("hudoverride")
local currencies = require("currencies")

-- hide the default coin counter
hudoverride.offsets.coins.value.y = hudoverride.offsets.coins.value.y - 50

-- register the custom coin counter with limit 99999
local coinCounter = currencies.registerCurrency(currencies.CURRENCY_COINS)
coinCounter:registerLimit(99999, function() end)

-- draw the coin counter
function onDraw()
    local offset = hudoverride.offsets.coins

    Text.printWP(
		string.format("%.5d", coinCounter:getMoney()), 1,
		400 + offset.x + offset.value.x - 34,
		50 + offset.y + offset.value.y,
		hudoverride.priority
	)
end
Download:
https://drive.google.com/file/d/14j4kfv ... sp=sharing

Credit is not required.

RotisserieSalad
Spiny
Spiny
Posts: 27
Joined: Tue Feb 06, 2024 3:57 pm
Flair: the terrible tormentor of twinks /j
Pronouns: he/him or they/them
Contact:

Re: Fixed lakitushop + Code to override the coin counter

Postby RotisserieSalad » Mon Feb 17, 2025 8:19 pm

It doesn't work with custom NPCs :(


Return to “LunaLua”

Who is online

Users browsing this forum: Petal [Bot] and 3 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari