I've been working on a custom instance, and I use a while loop to keep spawning monsters at certain positions while the boss fight is ongoing. Basically, the code looks like this:
while('alive){<stuff to spawn monsters>
sleep 45000;}
end;
It's working fine, and if I defeat the boss and leave the instance everything is perfect.
However, if the instance is destroyed while the boss is still alive (such as by timeout or by players disbanding their party), the Map Server returns a RID error (player not attached), as per the screenshot below:
Does anyone know how I could stop this from happening? It doesn't affect gameplay at all, but I'd hate having these erros clogging up the console every time someone fails the instance at the boss fight. I've tried using OnInstanceDestroy to disable the NPCs which are running these scripts, but it doesn't solve the issue. I also tried leaving everything inside the while loop blank except for the sleep command, so I know the mistake isn't on the script to spawn monsters but on the "while" itself.
I also checked if there's a player attached while the script is running and there isn't, which is why it strikes me as weird that the game would start complaining about that once the instance is destroyed.
Question
bodibastos
I've been working on a custom instance, and I use a while loop to keep spawning monsters at certain positions while the boss fight is ongoing. Basically, the code looks like this:
It's working fine, and if I defeat the boss and leave the instance everything is perfect.
However, if the instance is destroyed while the boss is still alive (such as by timeout or by players disbanding their party), the Map Server returns a RID error (player not attached), as per the screenshot below:
Does anyone know how I could stop this from happening? It doesn't affect gameplay at all, but I'd hate having these erros clogging up the console every time someone fails the instance at the boss fight. I've tried using OnInstanceDestroy to disable the NPCs which are running these scripts, but it doesn't solve the issue. I also tried leaving everything inside the while loop blank except for the sleep command, so I know the mistake isn't on the script to spawn monsters but on the "while" itself.
I also checked if there's a player attached while the script is running and there isn't, which is why it strikes me as weird that the game would start complaining about that once the instance is destroyed.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.