Jump to content

Recommended Posts

Posted

Hello guys i am trying to modify a script wich i thought would be easy but i am totally noob at scripting. Basically i have a script that adds amulets but it is only for female npc(neck seam cover). So i wanted to add it for males too for personal use, thought it would be simple (probably is) but im lost. So here is the original script:

 

  Reveal hidden contents

 

And here is my attempt at making a script for males using the same way to implement it:

 

  Reveal hidden contents

 

I thought it would be as easy as change the necklace id's and switch the IsFemale with Ismale, but IsMale doesn't work...

Help would be much appreciated.

Posted

Hmm, well, there is in fact no "IsMale" function counterpart to "IsFemale", but you also don't need any. "IsFemale" returns either 1 or 0, true or false, nothing else, and as such can be used to check for both.

Don't laugh, but the correct way of changing the female-only script above to male-only would have been to remove the "!" = "not" from in front of the "IsFemale" check, where it says "if the gender is not female, abort at this point" like so:

Turn

...
elseif eval !ThisNPC.IsFemale
continue
...

(abort, if not female, i.e. male)

into

...
elseif eval ThisNPC.IsFemale
continue
...

(abort, if female, i.e. not male)

Hope it helps. :thumbsup:

Posted

Ty Drake, I did try to do like you said (removing the !) but for some reasons none of my males npc get a necklace. I am obviously very lost in scripting world. I even tried to keep the original script unchanged and just remove the !, still no luck. I do not understand, seems so simple to do and it does not work. That is why i never script haha.

Posted

Hmm, maybe one or more of the other restrictions is fulfilled, i.e. they wear something which hides amulets, etc.

 

But could you give us the whole script the exact way it is now? It's always easier to check an actual script and see where something's wrong, than to blindly guess your way through to the culprit.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...