Thread: [Question] Trainer properties (items etc.)
View Single Post
Old December 16th, 2012, 04:52 PM
Maruno's Avatar
Lead Dev of Pokémon Essentials
Join Date: Jan 2008
Location: England
When you added code to pbCompileTrainers to allow for a 16th value, did you add a line saying poke[16]=poke[16].to_i? You need to turn it into an integer.

Also, the code you mentioned is wrong. Use this:

if poke[16] > 0 && poke[16] <= 100
  pokemon.hp = (pokemon.totalhp * poke[16] / 100).floor
At least you put it in the right place.