Finished pay function, added trade function to scriptobject