If you want the NPC to talk when a player walks near it, you can use the OnTouch label.
prontera,155,188,0 script Test_NPC 910,4,4,{
mes "You clicked me";
close;
OnTouch:
npctalk "Someone walked near me!";
end;
}
If you want the NPC to talk on a time interval (like every hour, or every 30 seconds) you can use OnClock labels or sleep inside of a loop.
prontera,155,188,0 script Test_NPC 910,4,4,{
mes "You clicked me";
close;
OnClock0700:
npctalk "It's 7:00 AM";
end;
OnClock1414:
npctalk "It's 2:14 PM";
end;
}
prontera,155,188,0 script Test_NPC 910,4,4,{
mes "You clicked me";
close;
OnInit:
while (1) {
sleep 30000;
npctalk "Another 30 seconds have passed.";
}
end;
}