script_getnum returns an int, so you should probably declare this as int.