Code: Select all
local customData = Data(Data.DATA_WORLD, true)
customData:set("cardboardCoin",0)
function onTick()
Text.print(customData:get("cardboardCoin"),0,0)
end
function onMessageBox(eventObj, msgStr)
if msgStr == "mysteryToadTalk" then
eventObj.cancelled = true
Text.showMessageBox("Hey, I'm known as Russ T. in these parts, but I can lend you some useful information if you lend me a cardboard coin.")
if customData:get("cardboardCoin") > 0 then
Text.showMessageBox("Huh, you dont got any cardboard coins on you?")
Text.showMessageBox("Well! We gotta teach you a lesson!")
Text.showMessageBox("Cardboard coins are what makes the world go 'round! They seem useless, but they are worth a fortune!")
Text.showMessageBox("There is five coins in each level, so they are easy money.")
Text.showMessageBox("They respawn so its easy to farm as well!")
end
Text.showMessageBox("So maybe I could have one? (Press X to lend a cardboard coin)")
if customData:get("cardboardCoin") == true then
if customData:get("cardboardCoin") > 0 then
customData:set("cardboardCoin",customData:get("cardboardCoin") - 1)
Text.showMessageBox("Thank you!")
-- here is supposed to be some code that tells different things after you progressively finish each level
else
Text.showMessageBox("Oh come on! Stop playing me, you dont have any cardboard coins!")
end
end
end
end