@Imtherealthing
@meaglyn is explaining that you can execute the “on_enter” script separately rather than try to merge it directly into the script.
I note from @andgalf posting of a script (a version of yours?) that you already do this for other scripts in lines that use the same ExecuteScript function. Therefore, the argument would be the same for your “on_enter” script to use the same ExecuteScript function to execute your new “on_enter” script just after these ones in your current OnClientEnter script.
EG:
ExecuteScript(“prcl_clnt_entr”, OBJECT_SELF);
ExecuteScript(“harperonenter”,OBJECT_SELF);
ExecuteScript(“bp_pal_enter”,GetEnteringObject());
ExecuteScript("on_enter", OBJECT_SELF);
object oPC=GetEnteringObject();
ExecuteScript(“x3_mod_pre_enter”,OBJECT_SELF); // Override for other skin systems
ExecuteScript(“cdj_nj_setup”, oPC);
BUT …
That all said, the script looks very awkward and I suspect does not compile in its current state. That is also quite a lot of “executions” one after the other that may require some attention to ensure events are executing at the best times.
My suspicion is that your requirements may have outgrown your current knowledge, even with basic use of the ExecuteScript function, and maybe it’s time to consider learning a bit more about scripting. Believe me, once you grasp the basics, you won’t look back.
I have written one such tutorial that you can take a look at. Bear in mind, I knew nothing about scripting at the start, and so it starts from that point of view: that you know nothing. I am sure others can suggest other tutorials too. The point being, once you have grasped some basic understanding, any suggestions put to you will start to make more sense to you too:
https://neverwintervault.org/project/nwn2/other/scripting-tutorial-beginners-nwn2
EDIT: Also, this post would have been better placed in the “Scripting” forum. You can edit your post and move it to the correct forum if you want more scripting attention.