Advertisement
Arnethegreat

Coin goal mode

Aug 19th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. MinimumCoins = false
  2. MaximumCoins = true
  3. MinCoinGoal = 40
  4. MaxCoinGoal = 10
  5. MidRingCoins = 0
  6.  
  7.  
  8. function firedeath()
  9.     memory.writebyte(0x7000AC, 40)
  10.     memory.writebyte(0x7001B0, 40)
  11.     memory.writebyte(0x7001D2, 34)
  12.     memory.writebyte(0x002140, 07)
  13.     yoshiisdead = false
  14.     die = 0
  15. end
  16.  
  17. lastframecoins = memory.readbyte(0x7E037B)
  18. collectedcoins = 0
  19. gui.opacity(0.8)
  20.  
  21. if MinimumCoins == true then
  22.     function mincoincheck()
  23.         gui.text(5,10,collectedcoins)
  24.         gui.text(15,10,"/")
  25.         gui.text(22,10,MinCoinGoal)
  26.         if gamemode == 16 and collectedcoins <= MinCoinGoal then
  27.             firedeath()
  28.         end
  29.     end
  30. else
  31.     function mincoincheck()
  32.     end
  33. end
  34.  
  35. if MaximumCoins == true then
  36.     function maxcoincheck()
  37.         gui.text(5,20,collectedcoins)
  38.         gui.text(15,20,"/")
  39.         gui.text(22,20,MaxCoinGoal)
  40.         if collectedcoins > MaxCoinGoal and memory.readbyte(0x7001AE) == 0 then
  41.             firedeath()
  42.             collectedcoins = 0
  43.         end
  44.     end
  45. else
  46.     function maxcoincheck()
  47.     end
  48. end
  49.  
  50. function coincounter()
  51.     savering = memory.readbyte(0x7E0B65)
  52.     gamemode = memory.readbyte(0x7E0118)
  53.     if memory.readbyte(0x7E037B) ~= lastframecoins  then
  54.         collectedcoins = collectedcoins + 1
  55.     end
  56.     if savering == 1 then
  57.         MidRingCoins = collectedcoins
  58.     end
  59.     if gamemode == 61 or gamemode == 34 then
  60.         collectedcoins = 0
  61.     end
  62.     if gamemode == 53 then
  63.         collectedcoins = MidRingCoins
  64.     end
  65.     mincoincheck()
  66.     maxcoincheck()
  67.     lastframecoins = memory.readbyte(0x7E037B)
  68.  
  69. end
  70.  
  71. while true do
  72.     coincounter()
  73.     emu.frameadvance()
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement