Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help with llsay line

Ryac Newman
Registered User
Join date: 2 Jan 2007
Posts: 2
06-22-2007 21:25
Hi, im learning how to script and i need some help with what im trying to do. This is the line im working on

llSay(0, name + " blah blah blah " + owner);

What i want is the name of the person who clicked the item to be said then the message then the name of the items owner. It works except i dont know how to get the owners name to be said.

Sorry if this doesnt make sense. getting a bit tired. been at this for ages

Help is greatly appreciated
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
06-22-2007 22:49
http://www.lslwiki.net/lslwiki/wakka.php?wakka=llGetOwner
Ryac Newman
Registered User
Join date: 2 Jan 2007
Posts: 2
06-23-2007 00:20
thankyou that works great
Ryac Newman
Registered User
Join date: 2 Jan 2007
Posts: 2
06-23-2007 00:40
thankyou for reply

ok im probably doing this all wrong but heres what ive got now.

It works and when clicked the item goes back into my inventory but now it tells me the name of the clicker not the name of the object owner.



integer CHANNEL = 42; // dialog channel
list MENU_MAIN = ["Remove"];

default
{
state_entry()
{
llListen(CHANNEL, "", NULL_KEY, "";);
}

touch_start(integer total_number)
{
llDialog(llDetectedKey(0), "What do you want to do?", MENU_MAIN, CHANNEL);
}

listen(integer channel, string name, key id, string message)
{
key ownerid;
string ownername;
string response_string;

ownerid = llGetOwnerKey(id);
ownername = llKey2Name(ownerid);


if (message == "Remove";)
{
llRequestPermissions(llGetOwner(), PERMISSION_ATTACH);
llSetObjectName("";);
llSay(0, name + " removes the items off " + ownername);
llDetachFromAvatar();
}
}
}
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
Owner
06-23-2007 01:57
try using llGetOwner() instead of llGetOwnerKey()

string ownername = llGetOwner();

also, add this:

on_rez(integer start_param)
{
llResetScript();
}

the owner is saved and llGetOwner() is only really done once... the reset on rez forces the script to "re-read" the owner.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
06-23-2007 02:50
llGetOwner returns the owners key not their name.
You will need to use llKey2Name to convert it.
Rather than reseting on rez reset on change of owner

CODE

string name;
string message = "blah blah blah";
default
{
state_entry()
{
name = llKey2Name(llGetOwner());
}

touch_start(integer total_number)
{
string toucher = llKey2Name(llDetectedKey(0));
llSay(0, toucher + " " + message + " " + name);
}

changed(integer change)
{
if(change & CHANGED_OWNER)llResetScript();
}
}
_____________________
I'm back......