A bit of bigginer help needed

where or how would i go about doing this?

Have you looked at the online documentation for what I posted? The code to do that is one of the examples.