Another way to say "hanging out at the bar is for having fun" is "people can have fun by hanging out at the bar."