I'm developing a "private server" for an online game and I'm basically reading commands from different files, example:
message = You search the crate . . .
anim = 881
wait = 2
message = You find nothing.
Theoretically what it should do is send the player a message saying "You search the crate . . .", and then a simple animation comes up and wait 2 seconds before displaying the message "You find nothing." The problem is that the delay happens at the begging of the script so it waits 2 seconds, and then it does the animation and sends both of the messages at the same time.
This should be useful:
if(token.startsWith("wait"))
{
try
{
Thread.sleep(Integer.parseInt(token3[0]) * 1000);
}
catch(Exception e)
{
}
}
Any help is highly appreciated; thanks in advance.