。
Don't come to school just to mess around.
Literal
Play-half-[adverbial-に] school [to-へ] come-[negative-imperative-な].
遊び半分 ('half-playing, half-seriously, in a frivolous spirit') is a fixed adverbial meaning 'half as play, not fully serious.' The 半分 ('half') suffix is productive: 冗談半分 ('half-joking'), 本気半分 ('half-serious'). ~な is the rough negative imperative. A stern admonishment, probably from a teacher to a goofing-off student.