Jump to content
  • 0

Include Script


Vincent

Question


  • Group:  Members
  • Topic Count:  130
  • Topics Per Day:  0.03
  • Content Count:  528
  • Reputation:   18
  • Joined:  09/11/12
  • Last Seen:  

Where have i to include those script? I only know how to use npc scripts.

-    script    News    -1,{
OnInit:
set .Time,60;        // Announce every x Minute.

setarray .News$[0],    // Random Message to be Announced
        "Updated News 1 every X Minute",
        "Updated News 2 every X Minute",
        "Updated News 3 every X Minute",
        "Updated News 4 every X Minute",
        "Updated News 5 every X Minute",
        "Updated News 6 every X Minute",
        "Updated News 7 every X Minute";
        
while( 1 ){
    announce .News$[ rand( getarraysize( .News$ ) ) ],0;
    sleep ( .Time * 60000 );
    }
end;
}
 

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

Well, that's in fact another NPC script, but you just can't visually see it. It's known as an invisible NPC. It just works without being in an specific map.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  130
  • Topics Per Day:  0.03
  • Content Count:  528
  • Reputation:   18
  • Joined:  09/11/12
  • Last Seen:  

So work like normal NPC? well thanks.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

Supposing it doesn't have any errors, it should work exactly as a normal NPC. But it just works without anyone seeing it. I reccomend to load it as in the NPC configurations then restarting the server to make sure that OnInit event is run.

 

Or well, you can simply add an OnWhisperGlobal label and then whisper to the NPC to make it run for the first time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...