Aller au contenu

Photo

I need minor help with this script


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Baishi7

Baishi7
  • Members
  • 23 messages
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);
}

#2
TheSpiritedLass

TheSpiritedLass
  • Members
  • 765 messages
Warning! I'm still on my first cup of coffee so not fully human yet. ;)



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

#3
Baishi7

Baishi7
  • Members
  • 23 messages
Show off.



Thanks alot, it works great!

#4
TheSpiritedLass

TheSpiritedLass
  • Members
  • 765 messages
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*