Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Simpel question about script...again

Snake Ornitz
Basic builder/scripter
Join date: 26 Oct 2005
Posts: 7
05-06-2006 06:13
Ive get syntax error when im using more than one if(massage=="";) do you need any other command for that. here is the whole script: Its has bin tested ingame before all other massage command has bin writed.
CODE

key owner;

default
{
state_entry()
{

owner=llGetOwner();
llListen(0,"",owner,"");
}
listen(integer channel, string name, key id, string message)
{
if(message=="Die")
{
llDie();
{
if(message=="Colorb")
{
llSetColor(<0.0, 0.0, 1.0>, ALL_SIDES)
{
if(message=="Colorr")
{
llSetColor(<1.0, 0.0, 0.0>, ALL_SIDES)
{
if(message=="Colorg")
{
llSetColor(<0.0, 1.0, 0.0>, ALL_SIDES)
}
}
}
Nick Shatner
Isn't a game
Join date: 11 Jul 2005
Posts: 39
05-06-2006 06:48
Hi there, you're missing out some semi-colons at the end of some of your function calls and braces the wrong way round, I'd also advise checking the wiki for how to use if-else, so it doesn't run through all the other ifs once its found what it's looking for.

IM me in world if you need any more help :)
CODE

key owner;

default
{
state_entry()
{

owner=llGetOwner();
llListen(0,"",owner,"");
}
listen(integer channel, string name, key id, string message)
{
if(message=="Die")
{
llDie();
} else
if(message=="Colorb")
{
llSetColor(<0.0, 0.0, 1.0>, ALL_SIDES);
} else
if(message=="Colorr")
{
llSetColor(<1.0, 0.0, 0.0>, ALL_SIDES);
} else
if(message=="Colorg")
{
llSetColor(<0.0, 1.0, 0.0>, ALL_SIDES);
}
}
}
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
05-06-2006 06:52
You're not closing the spans:
CODE

key owner;

default
{
state_entry()
{
owner=llGetOwner();
llListen(0,"",owner,"");
}
listen(integer channel, string name, key id, string message)
{
if(message=="Die")
{
llDie();
}
if(message=="Colorb")
{
llSetColor(<0.0, 0.0, 1.0>, ALL_SIDES)
}
if(message=="Colorr")
{
llSetColor(<1.0, 0.0, 0.0>, ALL_SIDES)
}
if(message=="Colorg")
{
llSetColor(<0.0, 1.0, 0.0>, ALL_SIDES)
}
}
}