Why are you using a timeout, and then a sleep for doing basically the same thing?
PHP Code:
if (playerenters) {
sleep 18.5;
setcharani idle,;
sleep 4;
setcharani sit,;
}
Remember, this is not something you would do online. I assume this is for the offline editor.