local health = script.Parent.Parent.Parent.Health
local tyman = script.Parent
health.Changed:Connect(function()
tyman.Text = "Health: "..health.Value
end)
This will fire every time the health is changed, assuming you’re changing the health, it should work.
in this context using wait() can be understandable but using .Changed is probably the most efficient, like you said. It just updates every second, but the .Changed runs everytime the value is changed.
local Health = script.Parent.Parent.Parent.Health
local tyman = script.Parent
Health:GetPropertyChangedSignal("Value"):Connect(function()
tyman.Text = "Health: "..Health.Value
end)
For it to change the text, you would want to listen if the value has changed. Using a while true do loop is not really efficient and can result in less performance, so we just need to get a signal if the value has changed.