Attempting to make custom script but failing