There is some sample code i posted of how to achive this, as well as a link to an already made script, Here