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 Posts

Latest Profile Posts

how does everybody even finish anything

i have like 5 projects in the backburner and it's just so sad that i probably won't get to finish all or maybe even any of them
Did you know that 90% of people in the world use the number in their sentence as they see fit?
It's been a long time since I was here but I have a lot of updates... btw I am teaching again about game programming and game design in some schools here in Brazil hahahaha It's good to see kids and teens learning this kind of thing!
welp, I literally can't continue working on ALEX now that my MZ trial is up (unless I somehow place in the jam which I don't remotely deserve to for my unfinished crap) so I am back on my bullshit

Forum statistics

Threads
113,891
Messages
1,078,233
Members
147,982
Latest member
GoyaGames
Top