OsNpcSayTo
From OpenSimulator
(Difference between revisions)
(Add exemple) |
|||
| Line 4: | Line 4: | ||
|delay=0 | |delay=0 | ||
|function_syntax=osNpcSayTo(key npc, key target, integer channel, string message) | |function_syntax=osNpcSayTo(key npc, key target, integer channel, string message) | ||
| − | |||
|description='''npc''' says '''message''' on the given '''channel''' to the specified '''target''' | |description='''npc''' says '''message''' on the given '''channel''' to the specified '''target''' | ||
| − | | | + | |ossl_example=<source lang="lsl"> |
| − | |additional_info=This function was added in 0.9.1.0 Dev | + | // |
| + | // osNpcSayTo Script Exemple | ||
| + | // Authior: djphil | ||
| + | // | ||
| + | |||
| + | key npc; | ||
| + | key user; | ||
| + | |||
| + | default | ||
| + | { | ||
| + | state_entry() | ||
| + | { | ||
| + | llSay(PUBLIC_CHANNEL, "Touch to see osNpcSayTo usage."); | ||
| + | } | ||
| + | |||
| + | touch_start(integer number) | ||
| + | { | ||
| + | user = llDetectedKey(0); | ||
| + | vector npcPos = llGetPos() + <-1.0, 0.0, 1.0>; | ||
| + | osAgentSaveAppearance(user, "appearance"); | ||
| + | npc = osNpcCreate("ImYour", "Clone", npcPos, "appearance"); | ||
| + | state hasNPC; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | state hasNPC | ||
| + | { | ||
| + | state_entry() | ||
| + | { | ||
| + | llSetTimerEvent(5.0); | ||
| + | } | ||
| + | |||
| + | timer() | ||
| + | { | ||
| + | llSetTimerEvent(0.0); | ||
| + | osNpcSayTo(npc, user, PUBLIC_CHANNEL, "Hello world!"); | ||
| + | osNpcSayTo(npc, user, PUBLIC_CHANNEL, "I Love OpenSimulator!"); | ||
| + | osNpcSayTo(npc, user, PUBLIC_CHANNEL, "The Open Source Metaverse!"); | ||
| + | } | ||
| + | |||
| + | touch_start(integer number) | ||
| + | { | ||
| + | osNpcSayTo(npc, user, PUBLIC_CHANNEL, "Goodbye!"); | ||
| + | llSetTimerEvent(0.0); | ||
| + | osNpcRemove(npc); | ||
| + | npc = NULL_KEY; | ||
| + | state default; | ||
| + | } | ||
| + | } | ||
| + | </source> | ||
| + | |additional_info=This function was added in 0.9.1.0 Dev<br> | ||
This function is based on llRegionSayTo, it therefore has no range limitation inside the region. | This function is based on llRegionSayTo, it therefore has no range limitation inside the region. | ||
}} | }} | ||
'''See Also''' | '''See Also''' | ||
| + | * [[osNpcWhisper]] | ||
* [[osNpcSay]] | * [[osNpcSay]] | ||
| + | * [[osNpcSayTo]] | ||
* [[osNpcShout]] | * [[osNpcShout]] | ||
| − | |||
Revision as of 06:53, 29 November 2020
osNpcSayTo(key npc, key target, integer channel, string message)
| |
| npc says message on the given channel to the specified target | |
| Threat Level | High |
| Permissions | ${OSSL|osslNPC} |
| Extra Delay | 0 seconds |
| Example(s) | |
// // osNpcSayTo Script Exemple // Authior: djphil // key npc; key user; default { state_entry() { llSay(PUBLIC_CHANNEL, "Touch to see osNpcSayTo usage."); } touch_start(integer number) { user = llDetectedKey(0); vector npcPos = llGetPos() + <-1.0, 0.0, 1.0>; osAgentSaveAppearance(user, "appearance"); npc = osNpcCreate("ImYour", "Clone", npcPos, "appearance"); state hasNPC; } } state hasNPC { state_entry() { llSetTimerEvent(5.0); } timer() { llSetTimerEvent(0.0); osNpcSayTo(npc, user, PUBLIC_CHANNEL, "Hello world!"); osNpcSayTo(npc, user, PUBLIC_CHANNEL, "I Love OpenSimulator!"); osNpcSayTo(npc, user, PUBLIC_CHANNEL, "The Open Source Metaverse!"); } touch_start(integer number) { osNpcSayTo(npc, user, PUBLIC_CHANNEL, "Goodbye!"); llSetTimerEvent(0.0); osNpcRemove(npc); npc = NULL_KEY; state default; } } | |
| Notes | |
| This function was added in 0.9.1.0 Dev This function is based on llRegionSayTo, it therefore has no range limitation inside the region. | |
See Also
- osNpcWhisper
- osNpcSay
- osNpcSayTo
- osNpcShout