I am trying to create a plane script.
The first line reads llSetVehicleType( VEHICLE_TYPE_AIRPLANE );
Now when I click save it says 'syntax error'. Can someone tell me why I get this error please?
These forums are CLOSED. Please visit the new forums HERE
Problem starting Script |
|
|
Larissa Summers
Registered User
Join date: 9 Mar 2006
Posts: 3
|
07-15-2006 05:27
I am trying to create a plane script.
The first line reads llSetVehicleType( VEHICLE_TYPE_AIRPLANE ); Now when I click save it says 'syntax error'. Can someone tell me why I get this error please? |
|
Danae Darkes
Registered User
Join date: 22 May 2006
Posts: 11
|
07-15-2006 08:45
Do you mean "first line" as in that is the absolute first line of code in your script?
LSL is an event driven language. Except for declaring variable types and constants all other lines of code must be contained in blocks - either an event handler or a function. And all event handlers must be defined within a state block. To wit: default { state_entry() { llSetVehicleType( VEHICLE_TYPE_AIRPLANE ); } } The LSL wiki is a good place to start - > http://secondlife.com/badgeo/wakka.php?wakka=HomePage |
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
07-15-2006 08:49
Welcome to the fora!
Um, if that's the absolutely first line of the script it's giving an error because it's looking for either a global variable declaration, a function declaration, or the start of the default state. Otherwise it looks good to me. If the line is properly in an event then check up the syntax, you might have something like an improperly closed bracket, semi-colon on the end of the event declaration line etc. Failing that... post the script so someone can see it and run their eye of it. _____________________
|
|
Ohforf Uram
n00b
Join date: 27 Jun 2006
Posts: 82
|
07-15-2006 08:52
If this is really the first line of your Script, the Answer is simple :
you have to call the Function inside a State see http://secondlife.com/badgeo/wakka.php?wakka=state or one of the Tutorials http://secondlife.com/badgeo/wakka.php?wakka=LSLTutorials You can save a lot of time by using an Example Airplane Script and modifying it. (i guess there was one in the Library part of the Inventory, i'm not sure about that) |
|
Larissa Summers
Registered User
Join date: 9 Mar 2006
Posts: 3
|
07-16-2006 02:01
Hi all, you have solved my problem thanks. Danae yes I did mean the absolute first line in the script. I did look at LSL Wiki beforehand aswell but it did'nt make it clear to me that it was an event driven language. But now I know.
|