Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

help with group permisison please

Kitari Elfenbeim
Registered User
Join date: 28 Apr 2008
Posts: 7
10-27-2008 10:52
This if from a lot larger script but I know the error is somewhere in here, be grateful if someone could point out the fix :)



blahblahblah rest script.... then...

touch_start(integer total_number)
{
{
if(llSameGroup(llDetectedKey(0)))
{
if (gfDoorClosed == FALSE)
{

gmSwingDoor(SW_CLOSE);
gfDoorClosed = TRUE;
return;
} else
{

gmSwingDoor(SW_OPEN);
gfDoorClosed = FALSE;
return;
}
}
}
else
{
llSay(0, "nice try";);
}
}

}
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
10-27-2008 11:24
From: Kitari Elfenbeim
This if from a lot larger script but I know the error is somewhere in here, be grateful if someone could point out the fix :)



blahblahblah rest script.... then...


you had two extra curly-braces in your script...

CODE


touch_start(integer total_number)
{
if(llSameGroup(llDetectedKey(0)))
{
if (gfDoorClosed == FALSE)
{

gmSwingDoor(SW_CLOSE);
gfDoorClosed = TRUE;
return;
} else
{

gmSwingDoor(SW_OPEN);
gfDoorClosed = FALSE;
return;
}
}
}
else
{
llSay(0, "nice try");
}

}

Kitari Elfenbeim
Registered User
Join date: 28 Apr 2008
Posts: 7
10-27-2008 11:37
I still get a syntax error in that section :(
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
10-27-2008 11:57
I would highly recommend (if you are able) that you use a program such as lsleditor (from lsleditor.org). This program will indicate what the error is so that you can figure it out much more easily.

Plugging the text into a blank script and formatting, I see that you have an extra curly brace before the last else. So the else . . "nice try" does not go with the if llSameGroup.

Try this instead . . .

touch_start(integer total_number)
{
if(llSameGroup(llDetectedKey(0)))
{
if (gfDoorClosed == FALSE)
{

gmSwingDoor(SW_CLOSE);
gfDoorClosed = TRUE;
return;
} else
{

gmSwingDoor(SW_OPEN);
gfDoorClosed = FALSE;
return;
}
} else
{
llSay(0, "nice try";);
}
}
Kitari Elfenbeim
Registered User
Join date: 28 Apr 2008
Posts: 7
10-27-2008 13:19
Thanks :) still got syntax error when tried plugging that in.. but once went over script again I saw the issue so it helped me solve the problem :)

Ill try that editor out, appreciate the hint :)