Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Health is not a valid member of Frame?

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

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

3 comments

1

If you explain something, Please use comments instead

0

If you explain something, Please use comments instead

0

If you explain something, Please use comments instead.

This discussion is preserved as it was. New answers, comments, and votes are closed.