Yes, you need to modify the code to obtain the result you’re interested in. This script could actually be a really good starting point. Here’s my suggested steps:
Figure out how LST is calculated in this script. The code used to calculate LST is LSTi=(b10BTi/(1+(((bCent*b10BTi)/rho)*Math.log(LSEi))))
The calculation in this script contains several constants, e.g., NDVIs for bare soil, NDVIv for full vegetation, C for surface roughness, etc. These constants can be area specific, so you may want to figure out the proper values for your area of interest.
Try to apply you calculation in the evalscript by modifying this example. The only difference is that the example calculates and returns NDVI, but you want to calculate and return LST.