Page 1 of 1

Help With Raocoins

Posted: Fri Oct 07, 2016 4:25 pm
by Artemis008
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?