Hamlet is a mastermind when it comes to plotting revenge. In this scene, it is merely a warning to his friends that the madness that he is about to portray is all an act to get revenge on Claudius and that his friends be a part of his madness and not hinder him from taking his revenge.