As others have indicated above, setting the setuid bit on a script won't do as you want.
This is because it constitutes a large security flaw -- users can break out of the script and execute arbitrary programs with the setuid privilege still active.
Using
sudo(8) or
doas(1) to confer privilege on the script has exactly the same security problem. You are just circumventing the protection built into the setuid mechanism.
The best solution is to rethink your problem. What is it that you actually need to do that requires elevated privilege? If you can define that precisely, then you may be able to use individual
sudo(8) commands within a non-privileged script (to execute individual binary executables) to achieve what you want.