-- -- Ring Counter Script by SonicX8000 -- -- This script scans for any Rings, Ring Boxes or Coins in the map. -- Handy for knowing how many rings or coins are in the map. -- Handy if you want to know how close you are to a Perfect Bonus. -- local ringlist -- The list of objects to add to the list. addHook("MobjSpawn", function(mobj) ringlist = $ + 1 end, MT_RING) addHook("MobjSpawn", function(mobj) ringlist = $ + 10 end, MT_RING_BOX) addHook("MobjSpawn", function(mobj) ringlist = $ + 1 end, MT_COIN) -- The list of objects to remove from the list, once collected or destroyed. addHook("TouchSpecial", function(special, toucher) ringlist = $ - 1 end, MT_RING) addHook("MobjDeath", function(target, inflictor, source) ringlist = $ - 10 end, MT_RING_BOX) addHook("TouchSpecial", function(special, toucher) ringlist = $ - 1 end, MT_COIN) -- The counter starts at zero per map change. addHook("MapChange", function(mapnum) ringlist = 0 end) -- Finally... time to draw the HUD, it will only draw if in Single-Player, Coop, or Competition. local function ringcounter(ringcounterhud, p, c) if not (G_GametypeUsesLives()) then return end if splitscreen then return end ringcounterhud.drawNum(96, 56, ringlist, V_SNAPTOTOP|V_SNAPTOLEFT) end hud.add(ringcounter)