ID:179330
 
Say i had a potion that gives 50 HP back

usr.HP+=50

But this is the problem, i dont want it to give back more hp then the maxHP. How would i make the normal HP not pass the maximum HP?
Add

if(src.HP>=src.MAXHP)
src.HP = src.MAXHP
In response to Nadrew
thanks and sorry about before
Tazor07 wrote:
Say i had a potion that gives 50 HP back

usr.HP+=50

But this is the problem, i dont want it to give back more hp then the maxHP. How would i make the normal HP not pass the maximum HP?

The absolute easiest way is this:
usr.HP=min(usr.HP+50,usr.maxHP)

Lummox JR