Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Health is not a valid member of Frame?

Asked by 3 years ago

I'm trying to make a health GUI but it won't work and this sign on the output says "Health is not a valid member of Frame"

Full Code:

       local Frame = script.Parent
                             local plr = game:GetService("Players").LocalPlayer
         local char = plr.Character or plr.CharacterAdded:Wait()
                 local hum = char:WaitForChild("Humanoid")
                hum.HealthChanged:Connect(function()
                                local percentage = hum.Health / hum.MaxHealth
                        Frame.Health:TweenSize(UDim2.fromScale(percentage, 
             Frame.Health.Size.Y.Scale))-- Error
                   Frame.HealthLabel.Text = math.floor(percentage * 100) .. "%"
                          end)

1 answer

Log in to vote
0
Answered by 3 years ago

Could it be because there is no such object named "Health" under Frame?

1
If you explain something, Please use comments instead RektwayYTB 123 — 3y
0
If you explain something, Please use comments instead RektwayYTB 123 — 3y
0
If you explain something, Please use comments instead. RektwayYTB 123 — 3y
Ad

Answer this question