-- name: Coin Magnet -- description: A mod that pulls coins towards Mario. -- author: jsaucer3 -- category: qol hook_event(HOOK_UPDATE, function() local m = gMarioStates[0].marioObj local o = obj_get_first_with_behavior_id(id_bhvYellowCoin) while o and m do local d = dist_between_objects(m, o) if d < 1000 then o.oPosX = o.oPosX + (m.oPosX - o.oPosX) * 0.1 o.oPosY = o.oPosY + (m.oPosY + 50 - o.oPosY) * 0.1 o.oPosZ = o.oPosZ + (m.oPosZ - o.oPosZ) * 0.1 end o = obj_get_next_with_same_behavior_id(o) end end)