add_hook("end_game", "start new game", start_new_game)
add_hook("end_game", "start new game", start_new_game)is all you need.
pos = get_joint_pos2(0,0) echo("x = "..pos.x) echo("y = "..pos.y) echo("z = "..pos.z)