Server Script not working

Hello, I am using this plugin. I have been trying to debug a server script I need to use for a backend workflow, but it’s not working.

The code looks like this:

var prices = await properties.thinglist1;
  var quantity = await properties.thinglist2;
  var voucherPrices = await properties.thinglist3;
  var vouchersApplied = await properties.thing1;

  // Create a copy of the prices array to avoid modifying the original array
  let modifiedPrices = [...prices];
  let remainingVouchers = vouchersApplied; // Track remaining vouchers

  // Combine prices, quantity, and voucherPrices arrays into an array of objects for easier sorting
  var combinedArray = await modifiedPrices.map((price, index) => ({
    price: price,
    quantity: quantity[index],
    voucherPrice: voucherPrices[index],
    index: index,
  }));

  // Sort the combined array based on price in ascending order
  combinedArray.sort((a, b) => a.price - b.price);
  // Sort the modified price as well
  modifiedPrices.sort((a, b) => a - b);
  console.log(modifiedPrices);

  // Apply vouchers to the prices in the sorted order
  for (let i = 0; i < combinedArray.length && remainingVouchers > 0; i++) {
    var voucherIndex = combinedArray[i].index;
    var price = combinedArray[i].price;
    var quantity = combinedArray[i].quantity;
    var voucherPrice = combinedArray[i].voucherPrice;

    var voucherUsage = Math.min(remainingVouchers, voucherPrice * quantity);
    // Calculate the new price based on the given formula
    modifiedPrices[voucherIndex] =
      (price * quantity - (price * voucherUsage) / voucherPrice) / quantity;

    remainingVouchers -= voucherUsage;
  }

  console.log(modifiedPrices);
  return { output1: modifiedPrices[0], outputlist1: modifiedPrices };

The script is pretty straightforward, but I can’t seem to make it work.