Why won't my character's max health change based on a certain stat?
Asked by
6 years ago Edited 6 years ago
I made stats like stamina, mana, etc. the max stamina and max mana worked perfectly, whenever you added a stat point, the max went up, but for some reason, It doesn't change the humanoid's max health, it doesn't show any errors or anything, it just does nothing to the humanoid health.
Script:
01 | local player = game.Players.LocalPlayer |
02 | local health = player:WaitForChild( "Stats" ):WaitForChild( "Health" ) |
03 | local playerhealth = player.Character:WaitForChild( "Humanoid" ).Health |
04 | local maxhealth = player.Character:WaitForChild( "Humanoid" ).MaxHealth |
05 | local stats = player:WaitForChild( "Stats" ) |
06 | local expmax = stats:WaitForChild( "ExpMax" ) |
07 | local level = stats:WaitForChild( "Level" ) |
08 | local stamina = stats:WaitForChild( "Stamina" ) |
09 | local maxstam = stats:WaitForChild( "MaxStam" ) |
10 | local stamstat = stats:WaitForChild( "StaminaStat" ) |
11 | local durability = stats:WaitForChild( "Durability" ) |
12 | local magic = stats:WaitForChild( "Magic" ) |
13 | local maxmana = stats:WaitForChild( "MaxMana" ) |
16 | health.Value = playerhealth |
17 | expmax.Value = level.Value * 100 |
18 | maxstam.Value = stamstat.Value* 2 + 100 |
19 | maxmana.Value = magic.Value* 2 + 100 |
20 | maxhealth = durability.Value* 2 + 100 |
I've tried simply putting the durability part in another script, but it still does the same thing, if you have any idea what's wrong, please let me know, because I need this to work for my friends game. Once again, it doesn't show any errors, warnings, etc. so I have no clue where to start.