Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Touch to open note script

Paladin Palmer
Registered User
Join date: 27 Dec 2006
Posts: 3
01-11-2007 17:23
I'm very new to scripting. I'm sure this is quite simple, but I'm having a hard time finding this. How could I script an item so that when it is touched, a note opens? Thank you for your help.

Aloha,
Paladin Palmer
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
01-11-2007 21:37
CODE

default
{
touch_start(integer t)
{
llGiveInventory(llDetectedKey(0), "the notecards exact name");
}
}

when the user touches the object they are given a copy of the notecard, which then automaticly opens in their viewer
Paladin Palmer
Registered User
Join date: 27 Dec 2006
Posts: 3
Mahalo nui!
01-12-2007 14:46
Wow! Thank you so much for your help!

Aloha,
Paladin Palmer
Johnmanix Willis
Registered User
Join date: 1 Jan 2007
Posts: 1
Doesn't Works
01-14-2007 11:50
Hello, heu... i'm sorry but it doesn't work with me...

Do you put your notecard in the global inventory? In the notecard directory? And the rename of a notecard don't change immediatly... What name should i put in the script?

Thanks a lot for your answer...
Winter Ventura
Eclectic Randomness
Join date: 18 Jul 2006
Posts: 2,579
01-14-2007 11:58
  1. put notecard in prim
  2. put script in prim
  3. put name of notecard, in script
  4. touch prim


it took longer to type this post, than it should take to do it in world.

Side note: (Wonder if this would work with UUID? 'Prolly not' would be my guess.)
_____________________

● Inworld Store: http://slurl.eclectic-randomness.com
● Website: http://www.eclectic-randomness.com
● Twitter: @WinterVentura
Jopsy Pendragon
Perpetual Outsider
Join date: 15 Jan 2004
Posts: 1,906
01-14-2007 12:23
I'm lazy: :D

CODE

default
{
state_entry() {
llSetText("Touch for\n" +
llGetInventoryName( INVENTORY_NOTECARD, 0),
<1,1,1>, 1.0);
}

touch_start(integer t)
{
llGiveInventory(llDetectedKey(0),
llGetInventoryName( INVENTORY_NOTECARD, 0) );
}

changed(integer n) { llResetScript(); }
}
_____________________
* The Particle Laboratory * - One of SecondLife's Oldest Learning Resources.
Free particle, control and targetting scripts. Numerous in-depth visual demonstrations, and multiple sandbox areas.
-
Stop by and try out Jopsy's new "Porgan 1800" an advanced steampunk styled 'particle organ' and the new particle texture store!