Author Topic: I need minor help with this script  (Read 668 times)

Legacy_Baishi7

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
I need minor help with this script
« on: July 25, 2010, 12:18:37 pm »


               This onenter area script is supposed to spawn a tree at a waypoint if someones journal is at the 3rd node.

Porblem is, it spawns no matter what part of the journal you're on.


//Put this script OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
int nInt;
nInt=GetLocalInt(oPC, "NW_JOURNAL_ENTRYasham");
if (nInt == 3)
   return;
object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("brambletree");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, "brambletree", lTarget);
}
               
               

               
            

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
I need minor help with this script
« Reply #1 on: July 25, 2010, 01:59:53 pm »


               Warning!  I'm still on my first cup of coffee so not fully human yet. '<img'>



If you want the tree to ONLY spawn if the journal (nInt) is 3... change this:



if (nInt == 3)  -- if the journal is 3, you tell the script to stop



to



if (nInt != 3) -- if the journal is not 3, stop planting trees.



Good luck!



-- Mistress
               
               

               
            

Legacy_Baishi7

  • Newbie
  • *
  • Posts: 43
  • Karma: +0/-0
I need minor help with this script
« Reply #2 on: July 25, 2010, 03:53:15 pm »


               Show off.



Thanks alot, it works great!
               
               

               
            

Legacy_TheSpiritedLass

  • Hero Member
  • *****
  • Posts: 1118
  • Karma: +0/-0
I need minor help with this script
« Reply #3 on: July 25, 2010, 03:58:52 pm »


               That was showing off?  I can't even understand what I wrote now.  *laughing*  Glad you could understand morning zombie mode and the code works for you.  *sassy grin*