Author Topic: Script help needed  (Read 10063 times)

Ser Red Ronnet Connington

  • Guest
Script help needed
« on: June 24, 2007, 05:34:45 PM »
int nInt;
object oTarget;

void main()
{

object oPC = GetExitingObject();

if(!GetIsPC(oPC)) return;

if(GetPCPlayerName(oPC) == "Ser Red Ronnet Connington")
  {
   AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("SerRedRonnetConnington");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(GetPCPlayerName(oPC) == "DemonRot")
  {
   AssignCommand(GetObjectByTag("masteravatar"), ActionSpeakString("Master Avatar has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masteravatar");


   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(GetPCPlayerName(oPC) == "God of Ruin")
  {
   AssignCommand(GetObjectByTag("masterbane"), ActionSpeakString("Master Bane has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masterbane");


   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

}

This script is intended to make a NPC announce a message, when a certain account has logged out of the module. The NPC is then supposed to be destroyed. The script works on my onexit area event, but not on the onclienet leave module event, which is where I want to put it. Can anyone help with this problem?

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Script help needed
« Reply #1 on: June 24, 2007, 08:04:39 PM »
Quote
The script works on my onexit area event, but not on the onclienet leave module event, which is where I want to put it. Can anyone help with this problem?
[snapback]36231[/snapback]
You can't use functions that return player information (like GetPCPlayerName) in the OnClientLeave event because the player is no longer there.

However, the player's avatar object still exists, so you can get any local variables set on it.

So, add these lines into the OnClientEnter event trigger:
Code: [Select]
object oPC = GetEnteringObject();

SetLocalString(oPC, "PCName", GetPCPlayerName());

Then instead of using GetPCPlayerName in OnClientLeave use GetLocalString. Use this method for GetPCPublicCDKey and GetPCIPAddress too.

-420
« Last Edit: June 24, 2007, 08:05:03 PM by 420 »

Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #2 on: June 25, 2007, 06:46:18 AM »
Quote
You can't use functions that return player information (like GetPCPlayerName) in the OnClientLeave event because the player is no longer there.

However, the player's avatar object still exists, so you can get any local variables set on it.

So, add these lines into the OnClientEnter event trigger:
Code: [Select]
object oPC = GetEnteringObject();

SetLocalString(oPC, "PCName", GetPCPlayerName());

Then instead of using GetPCPlayerName in OnClientLeave use GetLocalString. Use this method for GetPCPublicCDKey and GetPCIPAddress too.

-420
[snapback]36233[/snapback]

Thanks for the help again 420, but would it not be:

SetLocalString(oPC, "PCName", GetPCPlayerName(oPC));
instead of:
SetLocalString(oPC, "PCName", GetPCPlayerName());
?


Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #3 on: June 25, 2007, 07:04:20 AM »
int nInt;
object oTarget;

void main()
{

object oPC = GetExitingObject();

if(!GetIsPC(oPC)) return;

if(GetLocalString(oPC,"Ser Red Ronnet Connington"))
  {
   AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("SerRedRonnetConnington");


   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(GetLocalString(oPC,"DemonRot"))
  {
   AssignCommand(GetObjectByTag("masteravatar"), ActionSpeakString("Master Avatar has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masteravatar");


   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(GetLocalString(oPC,"God of Ruin"))
  {
   AssignCommand(GetObjectByTag("masterbane"), ActionSpeakString("Master Bane has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masterbane");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

}


This is what i did to the onclientleave. It wont compile, an integer error.

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Script help needed
« Reply #4 on: June 25, 2007, 11:41:18 AM »
Quote
Thanks for the help again 420, but would it not be:

SetLocalString(oPC, "PCName", GetPCPlayerName(oPC));
instead of:
SetLocalString(oPC, "PCName", GetPCPlayerName());
?
[snapback]36235[/snapback]
Yeah, I didn't compile the code.

Quote
int nInt;
object oTarget;

void main()
{

[snapback]36237[/snapback]
Those declarations (int and object) should be below the "void main()" and {

-420

Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #5 on: June 26, 2007, 09:17:18 AM »
Quote
Yeah, I didn't compile the code.
Those declarations (int and object) should be below the "void main()" and {

-420
[snapback]36238[/snapback]


420, thanks for the help. I have done that, moving the int and object below the void main and {. It still wont compile in that form.

I changed this for example:

Quote
if(GetLocalString(oPC,"Ser Red Ronnet Connington"))
{
   AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("SerRedRonnetConnington");


TO THIS, and even though it now compiles it still does not work.

Quote
if(GetLocalString(oPC,"") == "Ser Red Ronnet Connington")
  {
   AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("SerRedRonnetConnington");
« Last Edit: June 26, 2007, 09:18:46 AM by Ser Red Ronnet Connington »

Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #6 on: June 26, 2007, 09:23:00 AM »
So this is the script in total:

Quote
void main()
{
int nInt;
object oTarget;

object oPC = GetExitingObject();

if(!GetIsPC(oPC)) return;

if(GetLocalString(oPC,"") == "Ser Red Ronnet Connington")
  {
   AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("SerRedRonnetConnington");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(GetLocalString(oPC,"") == "DemonRot")
  {
   AssignCommand(GetObjectByTag("masteravatar"), ActionSpeakString("Master Avatar has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masteravatar");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(GetLocalString(oPC,"") == "God of Ruin")
  {
   AssignCommand(GetObjectByTag("masterbane"), ActionSpeakString("Master Bane has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masterbane");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

}

And the onenter script i have this:
Quote
SetLocalString(oPC, "Ser Red Ronnet Conninton", GetPCPlayerName(oPC));
SetLocalString(oPC, "God of Ruin", GetPCPlayerName(oPC));
SetLocalString(oPC, "DemonRot", GetPCPlayerName(oPC));

Offline Soul Sojourner

  • Resident Awesome
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2748
  • Nothing is true; everything is permitted.
    • View Profile
    • Email
Script help needed
« Reply #7 on: June 26, 2007, 10:24:52 AM »
I'm not much for scripting knowledge, but don't you need a "then" in your "if then" statements? In alot of cases I only see "if" or just "if" and then "else" but still no "then."

Like here:

Quote
if(GetLocalString(oPC,"Ser Red Ronnet Connington"))
{
  AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

  oTarget = GetObjectByTag("SerRedRonnetConnington");

Shouldn't it say something along the lines of:

Quote
if(GetLocalString(oPC,"Ser Red Ronnet Connington"))
{
  then AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

  oTarget = GetObjectByTag("SerRedRonnetConnington");

That's probably wrong, but it should properly get my meaning across. Maybe something like: IF it is you then [this happens] else if it is PC then [this will happen] else if it is [something else] then [something else will happen] etc.?

See, it just doesn't make sense to me to say "IF "something and not say "then" something. Then to say "else" [or else, else if] something else, doesn't fit right either, because the "then" was never stated. I see where the then's are after the if's, it's just not in the code. I don't know much about scripting as I said, so it might not even be necessary or something, but it just doesn't make sense to me without "then" after "if" and "else."

Just a thought. Not sure if it means anything or not, or if I'm just throwing shit around and don't know it. :lol:
« Last Edit: June 26, 2007, 10:32:39 AM by HeLLMasteRHeLL »

Offline Elessar Telrunya

  • Hero Member
  • *****
  • Posts: 2095
    • View Profile
Script help needed
« Reply #8 on: June 26, 2007, 11:04:48 AM »
My scripting knolledge isn't the greatest, but I don't think there is a possible THEN statement...as far as I know, it usually it goes something like this

IF (If condition)
{
What happens if condition is met
}
IF (Other If condition)
{
What happens if Condition is met
}
ELSE
{
What happens if neither of the above conditions were met
}

So I guess the THEN statement you're looking for goes inside the IF's...

-Elessar

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Script help needed
« Reply #9 on: June 26, 2007, 11:56:33 AM »
"Then" is an old C convention. It is implied in more modern languages.

Sorry I wasn't more clear on how to get the local strings to work.

OnClientEnter
Code: [Select]
object oPC = GetEnteringObject();

SetLocalString(oPC, "Name", GetPCPlayerName(oPC));
SetLocalString(oPC, "CD", GetPCPublicCDKey(oPC));
SetLocalString(oPC, "IP", GetPCIPAddress(oPC));

OnClientLeave
Code: [Select]
object oPC = GetExitingObject();

string PCName = GetLocalString(oPC, "Name");
string PCCD = GetLocalString(oPC, "CD");
string PCIP = GetLocalString(oPC, "IP");

Once those lines of code are set up you can do things like:
Code: [Select]
if(PCName == "Ser Red Ronnet Connington")
{

}

-420
« Last Edit: June 26, 2007, 11:59:59 AM by 420 »

Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #10 on: June 26, 2007, 01:35:38 PM »
Quote
"Then" is an old C convention. It is implied in more modern languages.

Sorry I wasn't more clear on how to get the local strings to work.

OnClientEnter
Code: [Select]
object oPC = GetEnteringObject();

SetLocalString(oPC, "Name", GetPCPlayerName(oPC));
SetLocalString(oPC, "CD", GetPCPublicCDKey(oPC));
SetLocalString(oPC, "IP", GetPCIPAddress(oPC));

OnClientLeave
Code: [Select]
object oPC = GetExitingObject();

string PCName = GetLocalString(oPC, "Name");
string PCCD = GetLocalString(oPC, "CD");
string PCIP = GetLocalString(oPC, "IP");

Once those lines of code are set up you can do things like:
Code: [Select]
if(PCName == "Ser Red Ronnet Connington")
{

}

-420
[snapback]36261[/snapback]


Thanks for the help again 420. Unfortunetly its compiling now but not working.

I assume this is what I need to do:
Onclient enter

Quote
SetLocalString(oPC, "Ser Red Ronnet Connington", GetPCPlayerName(oPC));
SetLocalString(oPC, "DemonRot", GetPCPlayerName(oPC));
SetLocalString(oPC, "God of Ruin", GetPCPlayerName(oPC));


I dont think I need to do it for Cd Key and Ip? And am supposed to put the account names inbetween the inverted comma's?

Then for Onclient leave id assume I only need:


Quote
object oPC = GetExitingObject();

string PCNamea = GetLocalString(oPC, "Ser Red Ronnet Connington");
string PCNameb = GetLocalString(oPC, "DemonRot");
string PCNamec = GetLocalString(oPC, "God of Ruin");

So the whole script would read.

Quote
void main()
{
int nInt;
object oTarget;

object oPC = GetExitingObject();

string PCNamea = GetLocalString(oPC, "Ser Red Ronnet Connington");
string PCNameb = GetLocalString(oPC, "DemonRot");
string PCNamec = GetLocalString(oPC, "God of Ruin");

if(!GetIsPC(oPC)) return;

if(PCNamea == "Ser Red Ronnet Connington")
  {
   AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("SerRedRonnetConnington");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(PCNameb == "DemonRot")
  {
   AssignCommand(GetObjectByTag("masteravatar"), ActionSpeakString("Master Avatar has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masteravatar");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

if(PCNamec == "God of Ruin")
  {
   AssignCommand(GetObjectByTag("masterbane"), ActionSpeakString("Master Bane has left!!!", TALKVOLUME_SHOUT));

   oTarget = GetObjectByTag("masterbane");

   nInt = GetObjectType(oTarget);

   if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
   else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

   DestroyObject(oTarget, 3.0);

}

}

Should that work?

I am really struggling to get it to.
« Last Edit: June 26, 2007, 01:45:08 PM by Ser Red Ronnet Connington »

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Script help needed
« Reply #11 on: June 26, 2007, 05:30:23 PM »
Don't change what's in the quotes.


This code sets a local string called Name that has the value of the PC's account name.
Code: [Select]
SetLocalString(oPC, "Name", GetPCPlayerName(oPC));

This code sets a local string called Ser Red Ronnet Connington that has the value of the PC's account name.
Code: [Select]
SetLocalString(oPC, "Ser Red Ronnet Connington", GetPCPlayerName(oPC));

You don't want the variable to be named Ser Red Ronnet Connington, you want it to be called Name and the string called Name will be the users account.

Copy these lines without changing anything:

OnClientEnter
Code: [Select]
object oPC = GetEnteringObject();

SetLocalString(oPC, "Name", GetPCPlayerName(oPC));

OnClientLeave
Code: [Select]
object oPC = GetExitingObject();

string PCName = GetLocalString(oPC, "Name");

If statements
Code: [Select]
if(PCName == "Ser Red Ronnet Connington")
{

}
else if(PCName == "DemonRot")
{

}
else if(PCName == "God of Ruin")
{

}
The name of the variable should always be "Name", the value that is stored on the PC under the title "Name" will be their account name.

Hope that clears things up, I always have trouble explaining things when I'm not face-to-face with people.

-420

Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #12 on: June 26, 2007, 06:50:30 PM »
Quote
void main()
{
int nInt;
object oTarget;

object oPC = GetExitingObject();

string PCName = GetLocalString(oPC, "Name");

if(!GetIsPC(oPC)) return;

if(PCName == "Ser Red Ronnet Connington")
  {
  AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("The master of this realm has left!!!", TALKVOLUME_SHOUT));

  oTarget = GetObjectByTag("SerRedRonnetConnington");

  nInt = GetObjectType(oTarget);

  if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
  else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

  DestroyObject(oTarget, 3.0);

}

else if(PCName == "DemonRot")
  {
  AssignCommand(GetObjectByTag("masteravatar"), ActionSpeakString("Master Avatar has left!!!", TALKVOLUME_SHOUT));

  oTarget = GetObjectByTag("masteravatar");

  nInt = GetObjectType(oTarget);

  if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
  else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

  DestroyObject(oTarget, 3.0);

}

else if(PCName == "God of Ruin")
  {
  AssignCommand(GetObjectByTag("masterbane"), ActionSpeakString("Master Bane has left!!!", TALKVOLUME_SHOUT));

  oTarget = GetObjectByTag("masterbane");

  nInt = GetObjectType(oTarget);

  if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), oTarget);
  else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SWINGING_BLADE), GetLocation(oTarget));

  DestroyObject(oTarget, 3.0);

}

}

Thats what I have done in the onclient leave. unfortunetly it still does not work I am not sure why. Thanks for the explanation you do a very good job 420. But why would it still not work. The script is supposed make the player who logs out, register his NPC, which is tagged as above, that is then supposed to announce a message that the PC has left, and then the NPC itself is destroyed. What could be wrong?

This is the entire onclient enter script:

Quote
#include"inc_emotewand"
#include"inc_bluewater"
void main()
{
object oPC = GetEnteringObject();

SetLocalString(oPC, "Name", GetPCPlayerName(oPC));

string sReport;
if(GetIsPC(oPC))
        {

        sReport = ">>> ID: " + GetPCPlayerName(oPC)
                    + "; Name: "+ GetName(oPC)
                    + "; CD Key:" + GetPCPublicCDKey(oPC)
                    + "; IP:" + GetPCIPAddress(oPC);

        WriteTimestampedLogEntry(sReport);


DelayCommand(10.0, ExecuteScript("myfilter", oPC));

}

StartBlueWaterGate(oPC,12,10,20,30,100,90000000,FALSE,FALSE,TRUE);

CollorModEnter("Collorgeneration");
}

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Script help needed
« Reply #13 on: June 26, 2007, 07:24:48 PM »
Try removing this line:
Code: [Select]
if(!GetIsPC(oPC)) return;
Just in case it returns false because the PC has logged out.

Also, try this line outside of any If statements and see if it fires when anyone leaves the server:
Code: [Select]
AssignCommand(GetObjectByTag("SerRedRonnetConnington"), ActionSpeakString("Someone left!", TALKVOLUME_SHOUT));
-420

Offline Soul Sojourner

  • Resident Awesome
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2748
  • Nothing is true; everything is permitted.
    • View Profile
    • Email
Script help needed
« Reply #14 on: June 26, 2007, 09:55:21 PM »
Ah, I always used then when doing if then's in NWN anyway and I guess I didn't have to. :lol: Well, it's not like it's hard to type "then" anyway. :D
« Last Edit: June 26, 2007, 09:55:58 PM by HeLLMasteRHeLL »

Ser Red Ronnet Connington

  • Guest
Script help needed
« Reply #15 on: June 26, 2007, 09:59:50 PM »
Thanks 420, removing that line has made the script work :)!

Offline Soul Sojourner

  • Resident Awesome
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2748
  • Nothing is true; everything is permitted.
    • View Profile
    • Email
Script help needed
« Reply #16 on: June 26, 2007, 10:02:22 PM »
Yay! Kudos to 420! :D

Offline 420

  • Hero Member
  • *****
  • Posts: 4087
    • View Profile
    • Email
Script help needed
« Reply #17 on: June 26, 2007, 10:57:48 PM »
Quote
Thanks 420, removing that line has made the script work!
[snapback]36273[/snapback]
Cool and since the OnClient events only trigger when a player logs into or out of a mod the GetIsPC function is superfluous in those scripts.

Looks like GetIsPC checks to see if an object is currently controlled by a player. So it can probably also be used to see if a player is possessing their familiar.

-420