ローカルじゃない場合はCreateでhogeを宣言したらいける。
hoge=5;
test()
別途スクリプト作成して
function test(){
show_debug_message(hoge);
}