How to collect sum of living party parameters?

Ayoni

Villager
Member
Joined
Aug 15, 2017
Messages
10
Reaction score
1
First Language
English
Primarily Uses
RMMV
Hello,

I am trying to create a total number that equals the sum of every living party members luk stat.

How can I make a script that will total up all living party members luk stat?
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
132
Reaction score
71
First Language
French
Primarily Uses
RMMV
Hello, this will put the sum of alive members luck in variable x, if it's what you need:
Code:
let num = 0;
for (let i in $gameParty.aliveMembers()) {
  num += $gameParty.aliveMembers()[i].luk;
}
$gameVariables.setValue(x, num);
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Person: "Taxes are bs and money is, too! Anarchy!!" *Literally anything goes wrong* Same Person: "Why hasn't the government fixed this???"
Stream will be live shortly with a session of Haunting Ground! Feel free to drop by!
As for the Coronavirus? Well: "People that spend their life avoiding death are already dead (they're also rich, and I like to spend my life with their money.)"
- R. Sanchez, "Edge of Tomorty: Rick, Die, Repeat"
making pierogi and corrupting my game files wbu

Forum statistics

Threads
94,345
Messages
920,111
Members
124,104
Latest member
SliferZhen
Top