of     1   

richarro123
#182780799Sunday, January 31, 2016 9:17 PM GMT

Hello there, Im making some kind of script to display a users health. it works fine and well but when i apply armour it doesnt work..... heres my script im using: while true do local hmn = script.Parent.Parent.Character.Humanoid local lvl = script.Parent.Parent.leaderstats.Lvl local con = script.Parent.Parent.attributes.Constitution hmn.MaxHealth = MaxHealth + (lvl.Value*10) + (con.Value*5) + 100 wait(0.1) end the armor adds maxhealth obviously and i have an attribute system that also players can add to max health too. so what i need is it to get the players maxhealth first, then add the attributes maxhealth bonus to it after. Can anyone help please.
CreativitiesUnity
#182782483Sunday, January 31, 2016 9:39 PM GMT

i'll take a better look at in in a bit, but for better efficiency, you should try while wait(.01) do, i mean it's not vital, but it certainly is neater in the end -your friendly neighborhood scripter
richarro123
#182783821Sunday, January 31, 2016 9:56 PM GMT

ok thanks, i had made the changes you said. Thanks Rich
richarro123
#182790482Sunday, January 31, 2016 11:36 PM GMT

i think, its needs to get the global variable maxhealth, then adds the "(lvl.Value*10) + (con.Value*5) + 100" after that, but then not run in a loop as when i do that it just keeps adding 100 to the health every .01 seconds and wont stop... Thanks Rich
richarro123
#182827649Monday, February 01, 2016 1:38 PM GMT

Anyone had a chance to look yet? My brain can't work out why it isn't working and really need help. Thankrich
rowerowe71
#182828960Monday, February 01, 2016 2:22 PM GMT

hmn.MaxHealth = hmn.MaxHealth + (lvl.Value*10) + (con.Value*5) + 100
richarro123
#182829645Monday, February 01, 2016 2:42 PM GMT

Tried that, just continuously adds 100 to max health every .01 second in a loop and doesn't stop. That was the first thing I did. Thanks Rich
rowerowe71
#182829878Monday, February 01, 2016 2:49 PM GMT

Because its in a loop -_-
Saldor010
#182830442Monday, February 01, 2016 3:06 PM GMT

Don't use a loop for something like this. Only have it triggered every time the person spawns and every time they level up. Also, I wouldn't use armor in conjunction with health, It'd probably be much more simple and easier to just have it be its own variable in combat when you're being attacked.
richarro123
#182830490Monday, February 01, 2016 3:07 PM GMT

But it doesn't work when I take it out of the loop -_-
Saldor010
#182831076Monday, February 01, 2016 3:22 PM GMT

If you're that helpless, then get out of this forum. I already told you what you need to do, now go do it. Unless this is a script you didn't even write yourself, in that case, get out of this forum.
richarro123
#182839460Monday, February 01, 2016 6:56 PM GMT

oh shud'dupa you face! ill do it when i get home from work

    of     1