Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Landmark & notecard Giver

Elorac Spire
Registered User
Join date: 16 Jan 2007
Posts: 21
02-25-2007 00:53
I have the scripts for both landmark and notecard giver...but how do I get them to work for a new shop? I know I have to insert the landmark and the notecard into the script but since I know NOTHING about scripting, can you please help me, how where do I do this? Thanks again, what would I do without you guys?
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
02-25-2007 01:30
From: Elorac Spire
I have the scripts for both landmark and notecard giver...but how do I get them to work for a new shop? I know I have to insert the landmark and the notecard into the script but since I know NOTHING about scripting, can you please help me, how where do I do this? Thanks again, what would I do without you guys?



The script will be written in one of two, or possibly three, ways.

1) Hard coded names for the the items
The code will contain a couple of lines similar to this

CODE

llGiveInventory(id, "MyNotecardName");
llGiveInventory(id, "MyLandmarkName");


2) Parameterised Names
The code to give the inventory items will be of this form:-

CODE

llGiveInventory(id, NotecardName);
llGiveInventory(id, LandmarkName);


Somewhere else in the code, probably at the top, will be a couple of lines something like

CODE

string NotecardName = "MyNotecardName";
string LandmarkName = "MyLandmarkName";


3) Dynamic Look up
In this version the script does not contain any names. It looks up the data when it is touched or possibly at start up / on rez. The former is the better solution

CODE

string NotecardName = llGetInventoryName(INVENTORY_NOTECARD,0);
string LandmarkName = llGetInventoryName(INVENTORY_LANDMARK,0);
if(NotecardName != "")llGiveInventory(id, NotecardName);
if(LandmarkName != "")llGiveInventory(id, LandmarkName);


HtH
Milcoi Delcon
Registered User
Join date: 24 May 2007
Posts: 30
06-22-2007 00:18
This one is very easy.... onclick gives you what you want:

default
{
touch_start(integer total_num)
{
llGiveInventory( llDetectedKey(0), "Insert name of notecard" );
llGiveInventory( llDetectedKey(0), "Insert name of landmark" );
}
}
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
06-22-2007 02:00
use llGiveInventoryList along with a list of items to give. They will be given all at once instead of one after the other.

llGiveInventoryList(UserKey,["Item 1","Item 2","Item n"]);