yes. ために, のに and ように have the meaning of 'for the purpose', but what are the differences?
also, i've asked my native japanese teacher, but she said のに and ように has no meaning similar to ために, and yet a lot of websites says they do.
now i'm really confused.
Maybe your teacher was thinking of the other use of のに (despite, although) for connecting sentences.
There's a lot of contexts where のに、ために overlap and you're fine either way (although native speakers can also disagree with what those sentences are in my experience

). As a general rule, though, のに in the sense of "in order to" I always try to use if the sentence focuses more on the
process of carrying out an action, as opposed concentrating on the end goal itself. What do we do or use to get where we want to end up ?
日本語を習得するのには、何年もかかります。is a classic illustration. Basically the Japanese way to get across "the process or act of mastering Japanese takes years" which is slightly awkward English but you wouldn't say either "The goal of mastering Japanese takes years" or "In order to master Japanese, it takes years."
ために on the other hand, is more general for "in order to" and some would say "safer" in a variety of situations but there are too many cases it simply cannot be applied grammatically. 本を買うために、本屋に行きます。is one such example that might not bother certain people but which I would find strange with のに (Focusing on the process or act, rather than the goal, of buying a book).
Finally, ように seems to be implying a much weaker cause and effect relationship than either of these. Even if you do such and such, the result is by no means guaranteed.
風邪を引かないように、コートを着てください。 (To try and not catch a cold, please put on a coat). 日本語を上達するように、毎日練習しています。(I am practicing everyday so that I might improve my Japanese).
ように I would argue is best in these sentences if you want to express a connotation that even if an action is performed (studying Japanese or putting on a coat), the result may not be the primary motivation for performing it (wearing a coat might be also to stay warm) or the outcome is not as assured as it would be with ために。Wearing a coat is essentially very unprotective against germs just as studying a little every day might not provide great confidence of language improvement.
Does that make it a little clearer or just a lot more confusing ???
I'll try to return here sometime with a few better examples. Just thinking through while writing this was still helpful for me, although there are some places that either のに、ために、ように is OK and those nuances can be maddeningly difficult to get your head around.
Even native speakers have a hard time laying out the distinctions and come out with a lot of ambiguous judgements among themselve.s

One other thing you may want to try is searching this site for our expert opinons of the past. There have been previous threads that have gone into more depth.
My only goal here was to get the ball rolling with a bare outline of a few of the most salient differences and common patterns unique to each of these constructions.
Ganbatte ne!