TP of all?

So, I want to store all the TP my party member has gained in a window. I made this approach:

for c in 0..$game_party.members.size tp_max+= $game_party.members[c].tp end hp_bar = [] for vin 0..$game_party.members.size hp_bar[v] = 143 * tp_max/ 300 # 300 is the maximum value endand somehow $game_party.members[actor_id].tp code does not give me the TP of that actor. What is my problem?
when are you calling it? Unless you have set the retain TP or something option, TP becomes 0 after battles...

PS: you could just do

Code:
tp_max = 0$game_party.members.each do |mem|  tp_max += mem.tpendhp_bar = []$game_party.members.each_index do |index|  hp_bar[index] = 143*tp_max/300end
though, why is the hp_bar part being set as the same for all of them?
Yes, sorry, this script is resolved, somehow I messed up a script.

Original thread: https://forums.rpgmakerweb.com/threads/tp-of-all.37123/