Help With Raocoins

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Artemis008
Boomerang Bro
Boomerang Bro
Posts: 1346
Joined: Mon Jul 06, 2015 4:34 pm

Help With Raocoins

Postby Artemis008 » Fri Oct 07, 2016 4:25 pm

I'm trying to replace the Yoshi houses in Return To Dinosaur Land with racoin2 shops as a way to get better with lua. I got the shop to show up and it does take dragon coins, but it doesn't give me a mushroom and flys Mario off screen when used.
The Lunadll code used.
Spoiler: show
raocoin = loadSharedAPI("raocoin2");
rc = raocoin.registerCurrency(274, true, 472, 66);

local shop = {}

shop["mushroom"] = { npc = 9, item = rc:addItem(4,function() triggerEvent("BuyMushroom"); end,true), x = -199616, y=-200128};

function onLoad()
for k,v in pairs(shop) do
v.item:placeToken(v.x,v.y,0,v.npc);
end
end

function raocoin.onCollect(currency)
if(currency.id == 0x00B2C5A8) then
currency:save();
end
end

function onEvent(name)
if(name == "UndoBuys") then
for k,v in pairs(shop) do
v.item:undoBuy();
end
end
end
The shop before use
Spoiler: show
Image
Right after use.
Spoiler: show
Image Mario continues moving right until he goes off screen and the level ends.
Another thing, if it would be possible to prevent it from disappearing so it can be used multiple times that would be nice.


EDIT: Okay, I got the mushroom to appear, now how do I keep the shop from disappearing?

Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 0 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari