Code won't work in Script space

I can't take a look into your issue since you haven't provided a reproducible example (I don't know from where the ss.pMap() function comes from).
If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.