Is there a reason why my hearts are not changing?
Asked by
5 years ago Edited 5 years ago
01 | local Player = game.Players.LocalPlayer |
02 | local Character = Player.Character |
03 | local Humanoid = Character:WaitForChild( "Humanoid" ) |
04 | local Store = game.ReplicatedStorage |
06 | local HeartContainers = Character.HealthSetter.HeartContainers |
07 | local Health = Humanoid.Health |
09 | local renderstep = game:GetService( "RunService" ).RenderStepped |
11 | renderstep:Connect( function () |
14 | for i = 1 , HeartContainers.Value do |
16 | local Heart = Player.PlayerGui.HealthBar [ tostring (Loaded) ] |
17 | if Heart.ImageTransparency = = 1 then |
18 | Heart.ImageTransparency = 0 |
26 | local Table = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } |
30 | if Number < Health then |
33 | elseif Number = = Health then |
36 | elseif Number > Health then |
46 | if Number 1 < 11 and not 11 then |
47 | local Heart = Player.PlayerGui.HealthBar [ tostring (Loaded) ] |
48 | if Table [ Number 1 ] = = 2 then |
49 | Heart.Image = Store.HeartAssets.FullHeart.Image |
50 | elseif Table [ Number 1 ] = = 1 then |
51 | Heart.Image = Store.HeartAssets.HalfHeart.Image |
52 | elseif Table [ Number 1 ] = = 0 then |
53 | Heart.Image = Store.HeartAssets.NoHeart.Image |
For some reason the new hearts I have display as a full heart (as they should) but none of the hearts seem to update. I've tried to troubleshoot but end up breaking it and no heart decals appear at all. Sorry for the flood lol