If one can decompile script easily, then one can also easily remove the key check easily.
However, in theory, one could encrypt part of the code, which can only be decrypted (on the fly) with key sent from some server.. every time that resource starts. (though acquiring that key wouldn't be too hard then as well).
If client (who wants resource from you) allows to open-source it later, then that is the best protection if you don't want anyone else to sell it. But if you want to sell the same content to multiple clients, then it's not a viable option.
You should research if the person you sell your stuff to, really is trustable or not (google him, ask others, etc).
Study some licenses and attach one with your script. If your client violates it and resells your content then you could use some legal measures.
If you have client side scripts, which can be easily copied by anyone - try to use more server side functions (e.g send some parts to server from client and do some work server-side).
Create a portfolio, so people can at least "see" what you've done, in order to avoid buying same thing from others.
Or. Just don't care.