I have more problems, when I write the code of the one scene in Scene_init the NPC runs ok, but only if I go out of the room the script runs, if I stay in the same room with the NPC, this repeat always the same animations, and never put NPC.Active= false the code is this:
var WindowsTime = new Date();
var cocineroOcupado = false;
var sitioCocinero = 0;
while (true)
{
if (NPC.Ready)
{
if(cocineroOcupado == false)
{
cocineroOcupado = true; //
tiempoInicio = Game.WindowsTime; //
}
else
{
if (WindowsTime.GetMinutes() > 27 && WindowsTime.GetMinutes() < 35)
{
if (sitioCocinero == 0)
{
NPC.Direction=DI_UP;
NPC.GoTo(485,525);
NPC.GoTo(389,400);
Sleep(3000);
if (WindowsTime.GetMinutes==34)
{
NPC.GoTo(686,454);
NPC.Active=false;
sitioCocinero = 1;
}
}
}
else NPC.Active=false;
}
}
else
{
cocineroOcupado = false;
}
Sleep(100);
}
if I stay with the NPC in the same room, this code never runs:
if (WindowsTime.GetMinutes==34)
{
NPC.GoTo(686,454);
NPC.Active=false;
sitioCocinero = 1;
}
and the question is: How I make the scripts to see the NPC in specific one minute the NPC go out of the room and if I go to the other room the NPC stay there walking?
I try with CurrentTime too, but the result is the same.
I want that the NPC stay in one room a few time, 35 minutes for example making some animations, and I want that the NPC when the time arrive at the 35 minute, the NPC go out of the room, it goes around the minimap, and arrives at the forrest and stay there playing some animations 24 minutes, for example, but in real time, not when I enter in the scene the NPC start his animation,
I dont know if I explain very well,
if some one can help me...
thanks!!!