1. You can use the onKeyboardPress(key) event or Misc.GetKeyState(key).
2. You can do this:
Code: Select all
local starcoin = require("npcs/ai/starcoin")
starcoin.getLevelList()
and this is how to run some code if the first star coin has been collected:
Code: Select all
if starcoin[1] then
-- Do something
end
Here's one more piece of advice: you should look at
https://docs.codehaus.moe for documentation and also look at other people's libraries (I didn't know about star coins until I looked at Minimalist HUD).