Difference between revisions of "Hello Avatar"

From Second Life Wiki
Jump to navigation Jump to search
(Undo revision 150653 by Coxigrue Bimbogami (Talk) stored it at Hello Avatar/fr)
(Mention that llInstantMessage and llOwnerSay often work better than the llSay of Hello Avatar for the purposes that script newbies have in mind)
Line 16: Line 16:
}
}
</lsl>
</lsl>
Notes:
* Newbies should learn to call the simpler [[llOwnerSay]] rather than llSay, in order to avoid making objects that spam the neighborhood via [[PUBLIC_CHANNEL]] zero.
* Newbies should learn to call [[llInstantMessage]] rather than llSay, in order to stop losing chat while far away or logged off.


{{#vardefine:sort|Hello Avatar}}{{LSLC|Library}}{{LSLC|Examples}}
{{#vardefine:sort|Hello Avatar}}{{LSLC|Library}}{{LSLC|Examples}}
{{LSLC|Tutorials}}
{{LSLC|Tutorials}}

Revision as of 11:58, 24 December 2008

The following script contains the default code that is placed in every new script. It says "Hello, Avatar" when it is saved or reset and says "Touched." when it is touched. That makes it the LSL representation of the famous Hello world program. <lsl> default {

   state_entry()
   {
       llSay(0, "Hello, Avatar!");
   }
   touch_start(integer total_number)
   {
       llSay(0, "Touched.");
   }

} </lsl>

Notes:

  • Newbies should learn to call the simpler llOwnerSay rather than llSay, in order to avoid making objects that spam the neighborhood via PUBLIC_CHANNEL zero.
  • Newbies should learn to call llInstantMessage rather than llSay, in order to stop losing chat while far away or logged off.