Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Where's the &*?*& syntax error ????

Patryk Stirling
Registered User
Join date: 30 Jul 2004
Posts: 26
12-12-2004 15:27
I got a syntax error in this code but I can't figure out why ??????????????????

It tells me that it is right before the l of the event listen...

CODE

attack()
{
llWhisper(0,"Ready for Orders !");
llListen( 0, "", llGetOwner(),"");
listen(integer channel, string name, key id, string message )
{
if(message=="pkjump")
{
llStopMoveToTarget(); // Stop any current MoveToTargets, just in case
vector currentPos = llGetPos(); // Gets the current position of the object
vector offsetPos = <0,0,50>; // Creates an offset vector of 2 meters on the Y axis
vector finalPos = currentPos + offsetPos; // Creates final position
llMoveToTarget( finalPos, 2.0 ) ; // Moves the object to that position over 1 second
}
}
}
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-12-2004 15:51
because thats not how events work.

CODE

default
{
state_entry()
{
llWhisper(0,"Ready for Orders !");
llListen( 0, "", llGetOwner(),"");
}
listen(integer channel, string name, key id, string message )
{
if(message=="pkjump")
{
llStopMoveToTarget(); // Stop any current MoveToTargets, just in case
vector currentPos = llGetPos(); // Gets the current position of the object
vector offsetPos = <0,0,50>; // Creates an offset vector of 2 meters on the Y axis
vector finalPos = currentPos + offsetPos; // Creates final position
llMoveToTarget( finalPos, 2.0 ) ; // Moves the object to that position over 1 second
}
}
}


:p
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
12-12-2004 15:51
Umm... you can't put a listen() event inside a function like that.

DAMMIT STRIFE! STOP TYPING SO DAMN FAST! Er... I mean, what Strife said. :o :D
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
12-12-2004 15:52
:p
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey