Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Wrapped code example with code block

...

NWScript has no way to directly target the screen for output. Instead, for instance, in-game characters such as the player character can be made to speak the typical “Hello world” example message. This script puts a “Hello world” message in the player’s message log. For it to work, it should be placed in the OnClientEnter event of the module’s properties.Void


Code Block
linenumberstrue
void main()

...


{

...


	SendMessageToPC(GetEnteringObject(), “Hello world”);

...


}


The first line is the void main function which is the function that a NWScript will start at. In the third line, the text Hello world is sent to the player’s in-game message log.

...