Crossroadrpg

Villager
Member
Joined
May 19, 2021
Messages
21
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hi, I am trying to make a situation where some characters, but not all of them can use some items.

I have been using this script for VisuStella Items and Equips Core from this board.

<JS Item Enable>
enabled = user._classId === <id of class that can use item>
</JS Item Enable>

and it worked like a charm, until I tried to allow the Item to work for multiple classes. Like a magic scroll that A Mage, a Witch, and an thief can use, but not the Fighter, Priest, or Hunter. Any help would be great.

 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,713
Reaction score
2,830
First Language
English
Primarily Uses
RMMZ
In that case, compare the class ID with an array. Let's say Mage, Witch and Thief are class IDs 5, 7 and 8 respectively:

<JS Item Enable>
enabled = [5, 7, 8].contains(user._classId)
</JS Item Enable>
 

Latest Threads

Latest Profile Posts

Why keyboards don't sleep? Because they have two shifts.
I realized a while ago my game was toooo big in scope. even now I wonder am I trying to do too much by myself. and that's after completely changing the format of the game.
Last week at SLC. Cali awaits. TBH I love SLC more than SF.
Back home now. I had a good time, but I had a checkup this morning so I had to come home for that. Now I'm just waiting for my therapist meeting tomorrow...
Decided to work on Wishful Wanda today. Since it's a BFB spinoff game, I decided to make the Huang brothers
Easter eggs! I'm actually pitching this to the BFDI team, btw.
I'm a bit perturbed that my two week project in a different engine is already shaping up to be far better than anything I've done in this one. It really calls into question my future plans. :kaoswt:

I guess I'll release whatever patches I made for Poppet Quest, then abandon it for my new project. I mean unless it somehow wins (I doubt it but hey sure). I'm not sure about And Remember Tomorrow.

Forum statistics

Threads
113,932
Messages
1,078,510
Members
148,042
Latest member
beanlad
Top