That script looks a bit like it was created by some LLM (chatgpt perhaps?). This part is incorrect
It should be fine if you remove Local(). Example from scripting index to give an idea of the syntax for functions
Names Default To Here(1);
// y is an optional argument
exmul = Function({x, y = 3}, x * y);
a = exmul(5);
b = exmul(5, 10);
Show(a, b);
Also it is very helpful if you add your script as JSL block instead of image. Press
and paste your script
-Jarmo