Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help whit my simple script

Snake Ornitz
Basic builder/scripter
Join date: 26 Oct 2005
Posts: 7
05-04-2006 07:08
Ive getting syntax errors on line 11 in my script whats wrong? here is the script

CODE

default
{
state_entry()
{
owner=llGetOwner();
llListen(0,"",owner,"");
}

listen(integer channel, string name, key id, string message)
{
}
if(message=="Start")
{
llWhisper(0,"Starting...");
}
else
{
llWhisper(0,"Wrong command");
}
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
05-04-2006 07:11
Double brace after the listen declaration "{}" which puts the if() outside any code block.

I assume you have declared "owner" above the snippet, if not you need "key owner;".
Snake Ornitz
Basic builder/scripter
Join date: 26 Oct 2005
Posts: 7
05-04-2006 07:21
Can you show me the whole script. When its edited because i can't script good and my English isn't the best. :)
Introvert Petunia
over 2 billion posts
Join date: 11 Sep 2004
Posts: 2,065
05-04-2006 08:02
CODE
default {
state_entry() {
key owner = llGetOwner();
llListen(0,"",owner,"");
}


listen(integer channel, string name, key id, string message) {
if(message=="Start") {
llWhisper(0,"Starting...");
} else {
llWhisper(0,"Wrong command");
}
}
}


This code has been tested in-game.
Neb Soyer
Really good looking.
Join date: 9 Apr 2006
Posts: 45
05-04-2006 13:58
If you don't need to refer to the key 'owner' later in the script then you can just set the listen function to: llListen(0,"",llGetOwner(),"";);

But if you are, then you need to declare it a global variable. Which means putting:

key owner = llGetOwner()

ABOVE the default state.
_____________________
down in the ghetto.