Class Change NPC

Hey guys and gals its me again with another question.

Im looking to make a "Class Trainer"
A NPC that sells Skillbooks but also allows a actor to change class once reaching a certain level.
(the skillbook thing is taken care of and works perfect)
Example:
ActorID 1 is ClassID 1 level 1
NPC sends you on your way.
ActorID 1 ClassID 1 level 10
NPC offers you to change your class to classID 2
then you have access to the shop.

I kinda figured out how to do this but its not working correctly using this:
$gameParty.members()[1].level >= 10 && $gameParty.members()[1].isClass($dataClasses[1]);

It lets me go through the change process but somehow it lets ActorID 1 change to the other class below level 10
if i have another level 10 actor in the party.

Any idea what im doing wrong?
Is there some reason you're using scripting rather than event commands? 😅

$gameParty.members()[1] refers to the second member of the party, not (necessarily) actor ID 1. Try $gameActors.actor(1). I think the rest of it is correct if you're using it in Conditional Branch > Script. 😤

Alternatively perhaps something like this?
Code:
◆If:Class of Harold is Hero
  ◆Control Variables:#0001 actorLevel = Level of Harold
  ◆If:actorLevel ≥ 10
    ◆Text:None, Window, Bottom
    :    :You qualify for a change of class!
    ◆Comment:Class change stuff here.
    ◆
  :Else
    ◆Jump to Label:nope
    ◆
  :End
  ◆
:Else
  ◆Label:nope
  ◆Text:None, Window, Bottom
  :    :Go get some more experience, then we'll talk.
  ◆
:End
◆Comment:Any other stuff to say.
Its the only thing i could find that kinda did what i wanted to
(for some reason i think complicated before thinking about the simpler ways)
eventing it will probably be the simpler way now that i see it 😅

but just to know for the future
$gameParty.members()[1] refers to the second member of the party... so 0 is 1 and so on?
Does this reference the Actors in the database or the order in the party?

Edit: So yeah i tested it. It references the party order not ID order. So my way wont work.

Thanks for solving my issue (should have thought about events 😅 )

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/class-change-npc.107732/