Posted by Thamoir Amanodel ( 80.41.xxx.xxx ) at 2004-09-25 06:24:00
// Sting I think i know what is wrong with your script if waht you put below is exactly what you typed...
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL))/* change this to good or neutral to let only good or neutral into that area */
{
oDeny = GetWaypointByTag("WP_tempofneutonly");
AssignCommand(oPC, JumpToObject(oDeny));
return;
}
//Here you are simply missing the last } put it in and the script should work, yes you will have one two lines with } one to end if and one to end main body
That is my script I put in. The error message is:
PM: Error. 'tempofneutonly' did not compile.
tempofneutonly.nss(16): ERROR: UNEXPECTED END COMPOUND STATEMENT
Indicating this line:
" }"
Also, I did this for another temple:
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL))/* change this to good or neutral to let only good or neutral into that area */
oDeny = GetWaypointByTag("WP_tempofevilonly");
AssignCommand(oPC, JumpToObject(oDeny));
return;
}
Error message said:
PM: Error. 'tempofevilonly' did not compile.
tempofevilonly.nss(9): ERROR: VARIABLE DEFINED WITHOUT TYPE
It was indicating this line:
" oDeny = GetWaypointByTag("WP_tempofevilonly");"
Those are the valid WP tags. Help please?
// The problem is you did not declare oDeny as an object, you need to insert this line at the beginning, after object oPC = GetEnteringObject();
object oDeny
that should resolve your problems, let me know (e-mail) if this works
Like the post below me, I'd prefer it to be a door or something so they don't have to load the temple and then reload the previous area.. but I am having problems with a few things. (Btw, I'm no scripter, don't laugh at me)
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL))/* change this to good or neutral to let only good or neutral into that area */
{
oDeny = GetWaypointByTag("WP_tempofneutonly");
AssignCommand(oPC, JumpToObject(oDeny));
return;
}
That is my script I put in. The error message is:
PM: Error. 'tempofneutonly' did not compile.
tempofneutonly.nss(16): ERROR: UNEXPECTED END COMPOUND STATEMENT
Indicating this line:
" }"
Also, I did this for another temple:
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL))/* change this to good or neutral to let only good or neutral into that area */
oDeny = GetWaypointByTag("WP_tempofevilonly");
AssignCommand(oPC, JumpToObject(oDeny));
return;
}
Error message said:
PM: Error. 'tempofevilonly' did not compile.
tempofevilonly.nss(9): ERROR: VARIABLE DEFINED WITHOUT TYPE
Like the post below me, I'd prefer it to be a door or something so they don't have to load the temple and then reload the previous area.. but I am having problems with a few things. (Btw, I'm no scripter, don't laugh at me)
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL))/* change this to good or neutral to let only good or neutral into that area */
{
oDeny = GetWaypointByTag("WP_tempofneutonly");
AssignCommand(oPC, JumpToObject(oDeny));
return;
}
That is my script I put in. The error message is:
PM: Error. 'tempofneutonly' did not compile.
tempofneutonly.nss(16): ERROR: UNEXPECTED END COMPOUND STATEMENT
Indicating this line:
" }"
Also, I did this for another temple:
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
if (!(GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL))/* change this to good or neutral to let only good or neutral into that area */
oDeny = GetWaypointByTag("WP_tempofevilonly");
AssignCommand(oPC, JumpToObject(oDeny));
return;
}
Error message said:
PM: Error. 'tempofevilonly' did not compile.
tempofevilonly.nss(9): ERROR: VARIABLE DEFINED WITHOUT TYPE
It was indicating this line:
" oDeny = GetWaypointByTag("WP_tempofevilonly");"
Those are the valid WP tags. Help please?
Posted by tom135235 ( 81.241.xxx.xxx ) at 2004-05-31 04:18:00
Hey, nice script.
Can you also change the script so that if you click on a door (church) it does an alignment check before you enter the area ?